Title: [260527] trunk/Source/WebKit
Revision
260527
Author
[email protected]
Date
2020-04-22 12:14:59 -0700 (Wed, 22 Apr 2020)

Log Message

IPC::decodeSharedBuffer() should check the return value of SharedMemory::map()
<https://webkit.org/b/210844>
<rdar://problem/60773120>

Reviewed by Geoffrey Garen.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::decodeSharedBuffer):
- Add nullptr check and early return.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (260526 => 260527)


--- trunk/Source/WebKit/ChangeLog	2020-04-22 18:59:39 UTC (rev 260526)
+++ trunk/Source/WebKit/ChangeLog	2020-04-22 19:14:59 UTC (rev 260527)
@@ -1,3 +1,15 @@
+2020-04-22  David Kilzer  <[email protected]>
+
+        IPC::decodeSharedBuffer() should check the return value of SharedMemory::map()
+        <https://webkit.org/b/210844>
+        <rdar://problem/60773120>
+
+        Reviewed by Geoffrey Garen.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::decodeSharedBuffer):
+        - Add nullptr check and early return.
+
 2020-04-22  Brent Fulgham  <[email protected]>
 
         Switch from debug ASSERT to RELEASE_ASSERT in toNPJSObject

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (260526 => 260527)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2020-04-22 18:59:39 UTC (rev 260526)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2020-04-22 19:14:59 UTC (rev 260527)
@@ -175,6 +175,9 @@
         return false;
 
     auto sharedMemoryBuffer = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly);
+    if (!sharedMemoryBuffer)
+        return false;
+
     buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), bufferSize);
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to