Title: [185712] trunk/Source/WebCore
Revision
185712
Author
[email protected]
Date
2015-06-18 11:16:55 -0700 (Thu, 18 Jun 2015)

Log Message

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

Patch by Joseph Pecoraro <[email protected]> on 2015-06-18
Reviewed by Timothy Hatcher.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (185711 => 185712)


--- trunk/Source/WebCore/ChangeLog	2015-06-18 18:05:52 UTC (rev 185711)
+++ trunk/Source/WebCore/ChangeLog	2015-06-18 18:16:55 UTC (rev 185712)
@@ -1,3 +1,14 @@
+2015-06-18  Joseph Pecoraro  <[email protected]>
+
+        Crash under WebCore::DOMWindow::dispatchMessageEventWithOriginCheck attempting to log console message
+        https://bugs.webkit.org/show_bug.cgi?id=146093
+
+        Reviewed by Timothy Hatcher.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
+        The console could be null so null check its use.
+
 2015-06-18  Csaba Osztrogonác  <[email protected]>
 
         Suppress null-conversion warnings in ANGLE

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (185711 => 185712)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2015-06-18 18:05:52 UTC (rev 185711)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2015-06-18 18:16:55 UTC (rev 185712)
@@ -934,9 +934,10 @@
     if (intendedTargetOrigin) {
         // Check target origin now since the target document may have changed since the timer was scheduled.
         if (!intendedTargetOrigin->isSameSchemeHostPort(document()->securityOrigin())) {
-            String message = "Unable to post message to " + intendedTargetOrigin->toString() +
-                             ". Recipient has origin " + document()->securityOrigin()->toString() + ".\n";
-            console()->addMessage(MessageSource::Security, MessageLevel::Error, message, stackTrace);
+            if (PageConsoleClient* pageConsole = console()) {
+                String message = makeString("Unable to post message to ", intendedTargetOrigin->toString(), ". Recipient has origin ", document()->securityOrigin()->toString(), ".\n");
+                pageConsole->addMessage(MessageSource::Security, MessageLevel::Error, message, stackTrace);
+            }
             return;
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to