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

Changeset 280838 in webkit


Ignore:
Timestamp:
Aug 10, 2021, 2:33:28 AM (5 years ago)
Author:
Adrian Perez de Castro
Message:

Merge r274160 - [IPC Hardening] IPC::decode(Decoder& decoder, RetainPtr<CFDictionaryRef>&) should make sure keys & values aren't null
https://bugs.webkit.org/show_bug.cgi?id=222980

Reviewed by Geoffrey Garen.

[NSMutableDictionary setObject:forKey:] throws an exception when the given object or key is nil. The dictionary decoder
should therefore fail nicely when either of these is nil, instead of crashing.

  • Shared/cf/ArgumentCodersCF.cpp:

(IPC::decode):

Location:
releases/WebKitGTK/webkit-2.32/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.32/Source/WebKit/ChangeLog

    r280837 r280838  
     12021-03-09  Chris Dumez  <cdumez@apple.com>
     2
     3        [IPC Hardening] IPC::decode(Decoder& decoder, RetainPtr<CFDictionaryRef>&) should make sure keys & values aren't null
     4        https://bugs.webkit.org/show_bug.cgi?id=222980
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        [NSMutableDictionary setObject:forKey:] throws an exception when the given object or key is nil. The dictionary decoder
     9        should therefore fail nicely when either of these is nil, instead of crashing.
     10
     11        * Shared/cf/ArgumentCodersCF.cpp:
     12        (IPC::decode):
     13
    1142021-03-09  Chris Dumez  <cdumez@apple.com>
    215
  • releases/WebKitGTK/webkit-2.32/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp

    r273116 r280838  
    459459    for (uint64_t i = 0; i < size; ++i) {
    460460        RetainPtr<CFTypeRef> key;
    461         if (!decode(decoder, key))
     461        if (!decode(decoder, key) || !key)
    462462            return false;
    463463
    464464        RetainPtr<CFTypeRef> value;
    465         if (!decode(decoder, value))
     465        if (!decode(decoder, value) || !value)
    466466            return false;
    467467
Note: See TracChangeset for help on using the changeset viewer.