Title: [240881] trunk/Source/WebKit
Revision
240881
Author
david_ques...@apple.com
Date
2019-02-01 15:08:48 -0800 (Fri, 01 Feb 2019)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (240880 => 240881)


--- trunk/Source/WebKit/ChangeLog	2019-02-01 22:52:58 UTC (rev 240880)
+++ trunk/Source/WebKit/ChangeLog	2019-02-01 23:08:48 UTC (rev 240881)
@@ -1,3 +1,16 @@
+2019-02-01  David Quesada  <david_ques...@apple.com>
+
+        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.
+
 2019-02-01  Chris Dumez  <cdu...@apple.com>
 
         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html

Modified: trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm (240880 => 240881)


--- trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm	2019-02-01 22:52:58 UTC (rev 240880)
+++ trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm	2019-02-01 23:08:48 UTC (rev 240881)
@@ -58,7 +58,7 @@
     });
     auto unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingFromData:nsData.get() error:nil]);
     [unarchiver setDecodingFailurePolicy:NSDecodingFailurePolicyRaiseException];
-    auto dictionary = retainPtr([unarchiver decodeObjectOfClasses:plistClasses forKey:@"NSKeyedArchiveRootObjectKey"]);
+    auto dictionary = adoptNS(static_cast<NSMutableDictionary *>([[unarchiver decodeObjectOfClasses:plistClasses forKey:@"NSKeyedArchiveRootObjectKey"] mutableCopy]));
     [unarchiver finishDecoding];
     [dictionary setObject:static_cast<NSString*>(path) forKey:@"NSURLSessionResumeInfoLocalPath"];
     auto encoder = adoptNS([[NSKeyedArchiver alloc] initRequiringSecureCoding:YES]);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to