mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb: Add a null-check for page() in ESO::is_scripting_enabled()
This could lead to a crash when spamming reload on a page with a <script> element.
This commit is contained in:
parent
9765f9f67e
commit
fe0f0b0acf
Notes:
sideshowbarker
2024-07-17 14:31:09 +09:00
Author: https://github.com/skyrising
Commit: fe0f0b0acf
Pull-request: https://github.com/SerenityOS/serenity/pull/13487
1 changed files with 1 additions and 1 deletions
|
@ -247,7 +247,7 @@ bool EnvironmentSettingsObject::is_scripting_enabled() const
|
|||
// The user has not disabled scripting for settings at this time. (User agents may provide users with the option to disable scripting globally, or in a finer-grained manner, e.g., on a per-origin basis, down to the level of individual environment settings objects.)
|
||||
auto document = const_cast<EnvironmentSettingsObject&>(*this).responsible_document();
|
||||
VERIFY(document);
|
||||
if (!document->window().page()->is_scripting_enabled())
|
||||
if (!document->page() || !document->page()->is_scripting_enabled())
|
||||
return false;
|
||||
|
||||
// FIXME: Either settings's global object is not a Window object, or settings's global object's associated Document's active sandboxing flag set does not have its sandboxed scripts browsing context flag set.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue