Crash in -[WKWebView _initializeWithConfiguration:]
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jun 2017 08:05:32 +0000 (08:05 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jun 2017 08:05:32 +0000 (08:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173126

Reviewed by Antti Koivisto.

Crash occurs when passing an autoreleased NSString into _setMediaContentTypesRequiringHardwareSupport.
The ivar should be a RetainPtr rather than a bare NSString *.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _mediaContentTypesRequiringHardwareSupport]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217967 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm

index c276289..e088177 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-09  Jer Noble  <jer.noble@apple.com>
+
+        Crash in -[WKWebView _initializeWithConfiguration:]
+        https://bugs.webkit.org/show_bug.cgi?id=173126
+
+        Reviewed by Antti Koivisto.
+
+        Crash occurs when passing an autoreleased NSString into _setMediaContentTypesRequiringHardwareSupport.
+        The ivar should be a RetainPtr rather than a bare NSString *.
+
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration _mediaContentTypesRequiringHardwareSupport]):
+
 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Use API::FormClient instead of the C API in WebKitFormClient
index ff88cb6..c9314cb 100644 (file)
@@ -138,7 +138,7 @@ private:
     BOOL _needsStorageAccessFromFileURLsQuirk;
 
     NSString *_overrideContentSecurityPolicy;
-    NSString *_mediaContentTypesRequiringHardwareSupport;
+    RetainPtr<NSString> _mediaContentTypesRequiringHardwareSupport;
 }
 
 - (instancetype)init
@@ -823,7 +823,7 @@ static NSString *defaultApplicationNameForUserAgent()
 
 - (NSString *)_mediaContentTypesRequiringHardwareSupport
 {
-    return _mediaContentTypesRequiringHardwareSupport;
+    return _mediaContentTypesRequiringHardwareSupport.get();
 }
 
 - (void)_setMediaContentTypesRequiringHardwareSupport:(NSString *)mediaContentTypesRequiringHardwareSupport