Title: [253710] trunk/Source/WebCore
Revision
253710
Author
[email protected]
Date
2019-12-18 12:44:13 -0800 (Wed, 18 Dec 2019)

Log Message

Protect ServiceWorker::postMessage from a null execState
https://bugs.webkit.org/show_bug.cgi?id=205394
<rdar://problem/57392221>

Reviewed by Chris Dumez.

Crash logs indicate null pointer crashes.
We should return early in that case.

* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (253709 => 253710)


--- trunk/Source/WebCore/ChangeLog	2019-12-18 20:32:55 UTC (rev 253709)
+++ trunk/Source/WebCore/ChangeLog	2019-12-18 20:44:13 UTC (rev 253710)
@@ -1,3 +1,17 @@
+2019-12-18  youenn fablet  <[email protected]>
+
+        Protect ServiceWorker::postMessage from a null execState
+        https://bugs.webkit.org/show_bug.cgi?id=205394
+        <rdar://problem/57392221>
+
+        Reviewed by Chris Dumez.
+
+        Crash logs indicate null pointer crashes.
+        We should return early in that case.
+
+        * workers/service/ServiceWorker.cpp:
+        (WebCore::ServiceWorker::postMessage):
+
 2019-12-18  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] LineBreaker::lastSoftWrapOpportunity should take a list of runs

Modified: trunk/Source/WebCore/workers/service/ServiceWorker.cpp (253709 => 253710)


--- trunk/Source/WebCore/workers/service/ServiceWorker.cpp	2019-12-18 20:32:55 UTC (rev 253709)
+++ trunk/Source/WebCore/workers/service/ServiceWorker.cpp	2019-12-18 20:44:13 UTC (rev 253710)
@@ -106,6 +106,8 @@
 
     auto* execState = context.execState();
     ASSERT(execState);
+    if (!execState)
+        return Exception { InvalidStateError };
 
     Vector<RefPtr<MessagePort>> ports;
     auto messageData = SerializedScriptValue::create(*execState, messageValue, WTFMove(options.transfer), ports, SerializationContext::WorkerPostMessage);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to