Changeset 259663 in webkit
- Timestamp:
- Apr 7, 2020, 1:03:17 PM (6 years ago)
- Location:
- branches/safari-609.2.1.2-branch/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
Platform/IPC/Connection.h (modified) (1 diff)
-
UIProcess/mac/WebPageProxyMac.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-609.2.1.2-branch/Source/WebKit/ChangeLog
r259662 r259663 1 2020-04-07 Alan Coon <alancoon@apple.com> 2 3 Apply patch. rdar://problem/61231889 4 5 2020-04-07 David Kilzer <ddkilzer@apple.com> 6 7 Cherry-pick r258507. rdar://problem/60500511 8 9 2020-03-16 David Kilzer <ddkilzer@apple.com> 10 11 WebPage::GetDataSelectionForPasteboard should validate its `size` variable 12 <https://webkit.org/b/209092> 13 <rdar://problem/60181345> 14 15 Reviewed by Brent Fulgham. 16 17 * Platform/IPC/Connection.h: 18 (MESSAGE_CHECK_WITH_RETURN_VALUE_BASE): Add. 19 - Variant of MESSAGE_CHECK_BASE() that takes a return value. 20 * UIProcess/mac/WebPageProxyMac.mm: 21 (MESSAGE_CHECK_WITH_RETURN_VALUE): Add. 22 (WebKit::WebPageProxy::dataSelectionForPasteboard): 23 - Use new MESSAGE_CHECK_WITH_RETURN_VALUE() macro to update 24 check for handle.isNull() and to add check for `size` 25 variable. 26 - Add static_cast<size_t>() to `size` variable to denote type 27 change. 28 1 29 2020-04-07 Russell Epstein <repstein@apple.com> 2 30 -
branches/safari-609.2.1.2-branch/Source/WebKit/Platform/IPC/Connection.h
r253177 r259663 85 85 while (0) 86 86 87 #define MESSAGE_CHECK_WITH_RETURN_VALUE_BASE(assertion, connection, returnValue) do \ 88 if (!(assertion)) { \ 89 ASSERT(assertion); \ 90 (connection)->markCurrentlyDispatchedMessageAsInvalid(); \ 91 return (returnValue); \ 92 } \ 93 while (0) 94 87 95 template<typename AsyncReplyResult> struct AsyncReplyError { 88 96 static AsyncReplyResult create() { return { }; }; -
branches/safari-609.2.1.2-branch/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
r259489 r259663 32 32 #import "AttributedString.h" 33 33 #import "ColorSpaceData.h" 34 #import "Connection.h" 34 35 #import "DataReference.h" 35 36 #import "EditorState.h" … … 68 69 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process().connection()) 69 70 #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(checkURLReceivedFromCurrentOrPreviousWebProcess(m_process, url), m_process->connection()) 71 #define MESSAGE_CHECK_WITH_RETURN_VALUE(assertion, returnValue) MESSAGE_CHECK_WITH_RETURN_VALUE_BASE(assertion, process().connection(), returnValue) 70 72 71 73 @interface NSApplication () … … 284 286 process().sendSync(Messages::WebPage::GetDataSelectionForPasteboard(pasteboardType), 285 287 Messages::WebPage::GetDataSelectionForPasteboard::Reply(handle, size), m_webPageID, messageTimeout); 286 if (handle.isNull()) 287 return nullptr; 288 RefPtr<SharedMemory> sharedMemoryBuffer = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly); 289 return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), size); 288 MESSAGE_CHECK_WITH_RETURN_VALUE(!handle.isNull(), nullptr); 289 // SharedMemory::Handle::size() is rounded up to the nearest page. 290 MESSAGE_CHECK_WITH_RETURN_VALUE(size <= handle.size(), nullptr); 291 292 auto sharedMemoryBuffer = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly); 293 return SharedBuffer::create(static_cast<unsigned char *>(sharedMemoryBuffer->data()), static_cast<size_t>(size)); 290 294 } 291 295
Note:
See TracChangeset
for help on using the changeset viewer.