API::Data::createWithoutCopying should do a null check before calling CFRelease
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 23:47:00 +0000 (23:47 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 23:47:00 +0000 (23:47 +0000)
commite6e1b8439568f37a68f2fbb4b036078748ab61e4
tree92cc42b31e9c726ffe055d20c0dd6bac43d86cd0
parentc3031e47386c6262c586fbe9bd0dac6ee8c0352f
API::Data::createWithoutCopying should do a null check before calling CFRelease
https://bugs.webkit.org/show_bug.cgi?id=196276
<rdar://problem/48059859>

Reviewed by Alex Christensen.

Source/WebKit:

* Shared/Cocoa/APIDataCocoa.mm:
(API::Data::createWithoutCopying):

Tools:

Add an API test that will pass a nil to API::Data::createWithoutCopying via NavigationState::NavigationClient::webCryptoMasterKey.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/navigation-client-default-crypto.html:
* TestWebKitAPI/Tests/WebKitCocoa/WebCryptoMasterKey.mm: Added.
(-[WebCryptoMasterKeyNavigationDelegate _webCryptoMasterKeyForWebView:]):
(-[WebCryptoMasterKeyNavigationDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/Shared/Cocoa/APIDataCocoa.mm
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit/navigation-client-default-crypto.html
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebCryptoMasterKey.mm [new file with mode: 0644]