Title: [273727] trunk
Revision
273727
Author
[email protected]
Date
2021-03-02 02:15:10 -0800 (Tue, 02 Mar 2021)

Log Message

Null check platformData when decoding
https://bugs.webkit.org/show_bug.cgi?id=221442

Patch by Rob Buis <[email protected]> on 2021-03-02
Reviewed by Ryosuke Niwa.

Source/WebKit:

Null check platformData when decoding.

Test: ipc/pasteboard-write-custom-data.html

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardCustomData::Entry>::decode):

LayoutTests:

Add test for this.

* ipc/pasteboard-write-custom-data-expected.txt: Added.
* ipc/pasteboard-write-custom-data.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (273726 => 273727)


--- trunk/LayoutTests/ChangeLog	2021-03-02 10:13:56 UTC (rev 273726)
+++ trunk/LayoutTests/ChangeLog	2021-03-02 10:15:10 UTC (rev 273727)
@@ -1,3 +1,15 @@
+2021-03-02  Rob Buis  <[email protected]>
+
+        Null check platformData when decoding
+        https://bugs.webkit.org/show_bug.cgi?id=221442
+
+        Reviewed by Ryosuke Niwa.
+
+        Add test for this.
+
+        * ipc/pasteboard-write-custom-data-expected.txt: Added.
+        * ipc/pasteboard-write-custom-data.html: Added.
+
 2021-03-01  Fujii Hironori  <[email protected]>
 
         [GTK] Web inspector related tests very slow or timeout in debug mode

Added: trunk/LayoutTests/ipc/pasteboard-write-custom-data-expected.txt (0 => 273727)


--- trunk/LayoutTests/ipc/pasteboard-write-custom-data-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/ipc/pasteboard-write-custom-data-expected.txt	2021-03-02 10:15:10 UTC (rev 273727)
@@ -0,0 +1 @@
+Test passes if it does not crash.

Added: trunk/LayoutTests/ipc/pasteboard-write-custom-data.html (0 => 273727)


--- trunk/LayoutTests/ipc/pasteboard-write-custom-data.html	                        (rev 0)
+++ trunk/LayoutTests/ipc/pasteboard-write-custom-data.html	2021-03-02 10:15:10 UTC (rev 273727)
@@ -0,0 +1,11 @@
+<!DOCTYPE html><!-- webkit-test-runner [ IPCTestingAPIEnabled=true ] -->
+<html>
+Test passes if it does not crash.
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.IPC) {
+    buf = new Uint8Array([0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0xff,0xff,0xff,0xff,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0xb,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,])
 ;
+    IPC.sendMessage('UI',9,IPC.messages.WebPasteboardProxy_WriteCustomData.name,[buf]);
+}
+</script>

Modified: trunk/Source/WebKit/ChangeLog (273726 => 273727)


--- trunk/Source/WebKit/ChangeLog	2021-03-02 10:13:56 UTC (rev 273726)
+++ trunk/Source/WebKit/ChangeLog	2021-03-02 10:15:10 UTC (rev 273727)
@@ -1,3 +1,17 @@
+2021-03-02  Rob Buis  <[email protected]>
+
+        Null check platformData when decoding
+        https://bugs.webkit.org/show_bug.cgi?id=221442
+
+        Reviewed by Ryosuke Niwa.
+
+        Null check platformData when decoding.
+
+        Test: ipc/pasteboard-write-custom-data.html
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<PasteboardCustomData::Entry>::decode):
+
 2021-03-02  Youenn Fablet  <[email protected]>
 
         Camera capture in iOS with GPUProcess enabled does not always handle orientation well at start up

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (273726 => 273727)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2021-03-02 10:13:56 UTC (rev 273726)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2021-03-02 10:15:10 UTC (rev 273727)
@@ -1571,7 +1571,7 @@
 
     if (hasBuffer) {
         RefPtr<SharedBuffer> value;
-        if (!decodeSharedBuffer(decoder, value))
+        if (!decodeSharedBuffer(decoder, value) || !value)
             return false;
         data.platformData = { value.releaseNonNull() };
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to