Changeset 272744 in webkit
- Timestamp:
- Feb 11, 2021, 1:30:31 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r272741 r272744 1 2021-02-11 Darin Adler <darin@apple.com> 2 3 [Cocoa] IPC decoder is using decoded size to allocate memory for an array 4 https://bugs.webkit.org/show_bug.cgi?id=221773 5 6 Reviewed by Geoffrey Garen. 7 8 * Shared/Cocoa/ArgumentCodersCocoa.mm: 9 (IPC::decodeArrayInternal): As with other similar structures, such a Vector and 10 CFArray, don't use the size to preallocate space when decoding an NSArray. The 11 decoded size is potentially incorrect, which we will discover indirectly when 12 decoding the array elements; we can't safely use the size to make a choice about 13 allocating memory beforehand. 14 1 15 2021-02-11 Brent Fulgham <bfulgham@apple.com> 2 16 -
trunk/Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
r264006 r272744 177 177 return WTF::nullopt; 178 178 179 RetainPtr<NSMutableArray> array = adoptNS([[NSMutableArray alloc] initWithCapacity:size]);179 auto array = adoptNS([[NSMutableArray alloc] init]); 180 180 for (uint64_t i = 0; i < size; ++i) { 181 181 auto value = decodeObject(decoder, allowedClasses);
Note:
See TracChangeset
for help on using the changeset viewer.