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

Changeset 259662 in webkit


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

Apply patch. rdar://problem/61231881

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

    r259661 r259662  
     12020-04-07  Russell Epstein  <repstein@apple.com>
     2
     3        Apply patch. rdar://problem/61231881
     4
     5    2020-04-07  David Kilzer  <ddkilzer@apple.com>
     6
     7            Cherry-pick r258374. rdar://problem/60396281
     8
     9        2020-03-12  David Kilzer  <ddkilzer@apple.com>
     10
     11            WebPageProxy::SaveImageToLibrary should validate its `imageSize` parameter
     12            <https://webkit.org/b/209012>
     13            <rdar://problem/60181295>
     14
     15            Reviewed by Chris Dumez.
     16
     17            * UIProcess/ios/WebPageProxyIOS.mm:
     18            (WebKit::WebPageProxy::saveImageToLibrary):
     19            - Validate upper bound of `imageSize` parameter.
     20            - Add static_cast<size_t>() to `imageSize` parameter to denote
     21              type change.
     22
    1232020-04-07  Alan Coon  <alancoon@apple.com>
    224
  • branches/safari-609.2.1.2-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r259661 r259662  
    648648{
    649649    MESSAGE_CHECK(!imageHandle.isNull());
    650     MESSAGE_CHECK(imageSize);
     650    // SharedMemory::Handle::size() is rounded up to the nearest page.
     651    MESSAGE_CHECK(imageSize && imageSize <= imageHandle.size());
    651652
    652653    auto sharedMemoryBuffer = SharedMemory::map(imageHandle, SharedMemory::Protection::ReadOnly);
     
    654655        return;
    655656
    656     auto buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), imageSize);
     657    auto buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), static_cast<size_t>(imageSize));
    657658    pageClient().saveImageToLibrary(WTFMove(buffer));
    658659}
Note: See TracChangeset for help on using the changeset viewer.