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

Changeset 185712 in webkit


Ignore:
Timestamp:
Jun 18, 2015, 11:16:55 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
https://bugs.webkit.org/show_bug.cgi?id=146093

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2015-06-18
Reviewed by Timothy Hatcher.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
The console could be null so null check its use.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185707 r185712  
     12015-06-18  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
     4        https://bugs.webkit.org/show_bug.cgi?id=146093
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * page/DOMWindow.cpp:
     9        (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
     10        The console could be null so null check its use.
     11
    1122015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
    213
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r185337 r185712  
    935935        // Check target origin now since the target document may have changed since the timer was scheduled.
    936936        if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrigin())) {
    937             String message = "Unable to post message to " + intendedTargetOrigin->toString() +
    938                              ". Recipient has origin " + document()->securityOrigin()->toString() + ".\n";
    939             console()->addMessage(MessageSource::Security, MessageLevel::Error, message, stackTrace);
     937            if (PageConsoleClient* pageConsole = console()) {
     938                String message = makeString("Unable to post message to ", intendedTargetOrigin->toString(), ". Recipient has origin ", document()->securityOrigin()->toString(), ".\n");
     939                pageConsole->addMessage(MessageSource::Security, MessageLevel::Error, message, stackTrace);
     940            }
    940941            return;
    941942        }
Note: See TracChangeset for help on using the changeset viewer.