⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259661 in webkit


Ignore:
Timestamp:
Apr 7, 2020, 1:03:10 PM (6 years ago)
Author:
Alan Coon
Message:

Apply patch. rdar://problem/61404555

Location:
branches/safari-609.2.1.2-branch/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609.2.1.2-branch/Source/WebKit/ChangeLog

    r259499 r259661  
     12020-04-07  Alan Coon  <alancoon@apple.com>
     2
     3        Apply patch. rdar://problem/61404555
     4
     5    2020-04-07  David Kilzer  <ddkilzer@apple.com>
     6
     7            Cherry-pick r258053. rdar://problem/60430195
     8
     9        2020-03-06  David Kilzer  <ddkilzer@apple.com>
     10
     11            IPC hardening for WebPageProxy::SaveImageToLibrary message
     12            <https://webkit.org/b/208730>
     13            <rdar://problem/58700693>
     14
     15            Reviewed by Chris Dumez.
     16
     17            * UIProcess/ios/WebPageProxyIOS.mm:
     18            (MESSAGE_CHECK): Define macro only for methods in this source file.
     19            (WebKit::WebPageProxy::saveImageToLibrary):
     20            - Make sure the shared memory handle sent over IPC is not null.
     21            - Make sure the image size sent over IPC is not zero.
     22            - Null check the SharedMemory object after calling
     23              SharedMemory::map().
     24
    1252020-04-03  Alan Coon  <alancoon@apple.com>
    226
  • branches/safari-609.2.1.2-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r256559 r259661  
    7777#endif
    7878
     79#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process().connection())
     80
    7981#define RELEASE_LOG_IF_ALLOWED(channel, fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), channel, "%p - [pageProxyID=%llu, webPageID=%llu, PID=%i] WebPageProxy::" fmt, this, m_identifier.toUInt64(), m_webPageID.toUInt64(), m_process->processIdentifier(), ##__VA_ARGS__)
    8082
     
    645647void WebPageProxy::saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize)
    646648{
     649    MESSAGE_CHECK(!imageHandle.isNull());
     650    MESSAGE_CHECK(imageSize);
     651
    647652    auto sharedMemoryBuffer = SharedMemory::map(imageHandle, SharedMemory::Protection::ReadOnly);
     653    if (!sharedMemoryBuffer)
     654        return;
     655
    648656    auto buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), imageSize);
    649657    pageClient().saveImageToLibrary(WTFMove(buffer));
     
    15001508
    15011509#undef RELEASE_LOG_IF_ALLOWED
     1510#undef MESSAGE_CHECK
    15021511
    15031512#endif // PLATFORM(IOS_FAMILY)
Note: See TracChangeset for help on using the changeset viewer.