⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276530 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 4:45:57 PM (5 years ago)
Author:
rniwa@webkit.org
Message:

Crash in constructCustomElementSynchronously
https://bugs.webkit.org/show_bug.cgi?id=224992
<rdar://66988026>

Reviewed by Tadeu Zagallo.

Exit early when the global object is nullptr although this shouldn't happen.

No new tests since we have no reproductions.

  • bindings/js/JSCustomElementInterface.cpp:

(WebCore::JSCustomElementInterface::tryToConstructCustomElement): Added a null check.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r276528 r276530  
     12021-04-23  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Crash in constructCustomElementSynchronously
     4        https://bugs.webkit.org/show_bug.cgi?id=224992
     5        <rdar://66988026>
     6
     7        Reviewed by Tadeu Zagallo.
     8
     9        Exit early when the global object is nullptr although this shouldn't happen.
     10
     11        No new tests since we have no reproductions.
     12
     13        * bindings/js/JSCustomElementInterface.cpp:
     14        (WebCore::JSCustomElementInterface::tryToConstructCustomElement): Added a null check.
     15
    1162021-04-23  Don Olmstead  <don.olmstead@sony.com>
    217
  • trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp

    r268700 r276530  
    100100
    101101    ASSERT(&document == scriptExecutionContext());
    102     auto& lexicalGlobalObject = *document.globalObject();
    103     auto element = constructCustomElementSynchronously(document, vm, lexicalGlobalObject, m_constructor.get(), localName);
     102    auto* lexicalGlobalObject = document.globalObject();
     103    ASSERT(lexicalGlobalObject);
     104    if (!lexicalGlobalObject)
     105        return nullptr;
     106    auto element = constructCustomElementSynchronously(document, vm, *lexicalGlobalObject, m_constructor.get(), localName);
    104107    EXCEPTION_ASSERT(!!scope.exception() == !element);
    105108    if (!element) {
    106109        auto* exception = scope.exception();
    107110        scope.clearException();
    108         reportException(&lexicalGlobalObject, exception);
     111        reportException(lexicalGlobalObject, exception);
    109112        return nullptr;
    110113    }
Note: See TracChangeset for help on using the changeset viewer.