Title: [247786] trunk/Source/WebKit
Revision
247786
Author
[email protected]
Date
2019-07-24 13:18:50 -0700 (Wed, 24 Jul 2019)

Log Message

Null check CompletionHandler in WebPreviewLoaderClient::didReceivePassword
https://bugs.webkit.org/show_bug.cgi?id=200080
<rdar://problem/37275772>

Patch by Alex Christensen <[email protected]> on 2019-07-24
Reviewed by Chris Dumez.

* WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
(WebKit::WebPreviewLoaderClient::didReceivePassword):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (247785 => 247786)


--- trunk/Source/WebKit/ChangeLog	2019-07-24 20:12:32 UTC (rev 247785)
+++ trunk/Source/WebKit/ChangeLog	2019-07-24 20:18:50 UTC (rev 247786)
@@ -1,3 +1,14 @@
+2019-07-24  Alex Christensen  <[email protected]>
+
+        Null check CompletionHandler in WebPreviewLoaderClient::didReceivePassword
+        https://bugs.webkit.org/show_bug.cgi?id=200080
+        <rdar://problem/37275772>
+
+        Reviewed by Chris Dumez.
+
+        * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
+        (WebKit::WebPreviewLoaderClient::didReceivePassword):
+
 2019-07-24  Chris Dumez  <[email protected]>
 
         Crash under WebKit:WTF::Detail::CallableWrapper<WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking(WTF::CompletionHandler<void ()>&&)::$_32::operator()()::'lambda'(), void>::call

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp (247785 => 247786)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp	2019-07-24 20:12:32 UTC (rev 247785)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp	2019-07-24 20:18:50 UTC (rev 247786)
@@ -28,6 +28,7 @@
 
 #if USE(QUICK_LOOK)
 
+#include "Logging.h"
 #include "WebPageProxyMessages.h"
 #include "WebProcess.h"
 #include <WebCore/QuickLook.h>
@@ -88,8 +89,10 @@
 void WebPreviewLoaderClient::didReceivePassword(const String& password, WebCore::PageIdentifier pageID)
 {
     ASSERT(passwordCallbacks().contains(pageID));
-    auto completionHandler = passwordCallbacks().take(pageID);
-    completionHandler(password);
+    if (auto completionHandler = passwordCallbacks().take(pageID))
+        completionHandler(password);
+    else
+        RELEASE_LOG_ERROR(Loading, "Discarding a password for a page that did not request one in this process");
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to