Changeset 240881 in webkit


Ignore:
Timestamp:
Feb 1, 2019 3:08:48 PM (5 years ago)
Author:
david_quesada@apple.com
Message:

Network Process crash when resuming downloads: '-[NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
https://bugs.webkit.org/show_bug.cgi?id=194144
rdar://problem/47553456

Reviewed by Geoffrey Garen.

  • NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:

(WebKit::Download::resume):

Make a mutable copy of the root object decoded from the resume data.
It might have been originally encoded as an immutable dictionary.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r240880 r240881  
     12019-02-01  David Quesada  <david_quesada@apple.com>
     2
     3        Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p'
     4        https://bugs.webkit.org/show_bug.cgi?id=194144
     5        rdar://problem/47553456
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
     10        (WebKit::Download::resume):
     11            Make a mutable copy of the root object decoded from the resume data.
     12            It might have been originally encoded as an immutable dictionary.
     13
    1142019-02-01  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm

    r239815 r240881  
    5959    auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingFromData:nsData.get() error:nil]);
    6060    [unarchiver setDecodingFailurePolicy:NSDecodingFailurePolicyRaiseException];
    61     auto dictionary = retainPtr([unarchiver decodeObjectOfClasses:plistClasses forKey:@"NSKeyedArchiveRootObjectKey"]);
     61    auto dictionary = adoptNS(static_cast<NSMutableDictionary *>([[unarchiver decodeObjectOfClasses:plistClasses forKey:@"NSKeyedArchiveRootObjectKey"] mutableCopy]));
    6262    [unarchiver finishDecoding];
    6363    [dictionary setObject:static_cast<NSString*>(path) forKey:@"NSURLSessionResumeInfoLocalPath"];
Note: See TracChangeset for help on using the changeset viewer.