Title: [260689] trunk/Source/WebKit
Revision
260689
Author
[email protected]
Date
2020-04-24 18:32:58 -0700 (Fri, 24 Apr 2020)

Log Message

WebPasteboardProxy::getPasteboardStringsForType() and WebPasteboardProxy::readURLFromPasteboard() should check return value of SharedMemory::createHandle()
<https://webkit.org/b/211002>

Reviewed by Wenson Hsieh.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
- Check result of SharedMemory::createHandle() and return early
  on failure.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (260688 => 260689)


--- trunk/Source/WebKit/ChangeLog	2020-04-25 00:52:38 UTC (rev 260688)
+++ trunk/Source/WebKit/ChangeLog	2020-04-25 01:32:58 UTC (rev 260689)
@@ -1,3 +1,16 @@
+2020-04-24  David Kilzer  <[email protected]>
+
+        WebPasteboardProxy::getPasteboardStringsForType() and WebPasteboardProxy::readURLFromPasteboard() should check return value of SharedMemory::createHandle()
+        <https://webkit.org/b/211002>
+
+        Reviewed by Wenson Hsieh.
+
+        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
+        (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
+        (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
+        - Check result of SharedMemory::createHandle() and return early
+          on failure.
+
 2020-04-24  Chris Dumez  <[email protected]>
 
         [iOS] Unable to sign up on twitter.com

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm (260688 => 260689)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm	2020-04-25 00:52:38 UTC (rev 260688)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm	2020-04-25 01:32:58 UTC (rev 260689)
@@ -185,7 +185,8 @@
         return completionHandler({ }, 0);
     memcpy(sharedMemoryBuffer->data(), buffer->data(), size);
     SharedMemory::Handle handle;
-    sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly);
+    if (!sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly))
+        return completionHandler({ }, 0);
     completionHandler(WTFMove(handle), size);
 }
 
@@ -387,7 +388,8 @@
         return completionHandler({ }, 0);
     memcpy(sharedMemoryBuffer->data(), buffer->data(), size);
     SharedMemory::Handle handle;
-    sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly);
+    if (!sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly))
+        return completionHandler({ }, 0);
     completionHandler(WTFMove(handle), size);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to