Title: [295070] trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm
Revision
295070
Author
[email protected]
Date
2022-05-31 15:24:11 -0700 (Tue, 31 May 2022)

Log Message

[WebAuthn][ios] weakThis not checked before clearing ASCProxy
https://bugs.webkit.org/show_bug.cgi?id=241029
rdar://93932684

Reviewed by Brent Fulgham.

This issue causes crashes after cancelling some types of requests. This change
has been tested on device to verify it fixes the crash.

* Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm:

Canonical link: https://commits.webkit.org/251165@main

Modified Paths

Diff

Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm (295069 => 295070)


--- trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm	2022-05-31 22:22:07 UTC (rev 295069)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm	2022-05-31 22:24:11 UTC (rev 295070)
@@ -446,7 +446,8 @@
                     return;
                 }
                 continueAfterRequest(credential, error, WTFMove(handler));
-                weakThis->m_proxy.clear();
+                if (weakThis->m_proxy)
+                    weakThis->m_proxy.clear();
             });
         }).get()];
         return;
@@ -462,7 +463,7 @@
             if (!weakThis || !daemonEndpoint) {
                 LOG_ERROR("Could not connect to authorization daemon: %@\n", error.get());
                 handler({ }, (AuthenticatorAttachment)0, ExceptionData { NotAllowedError, "Operation failed."_s });
-                if (weakThis)
+                if (weakThis && weakThis->m_proxy)
                     weakThis->m_proxy.clear();
                 return;
             }
@@ -473,7 +474,8 @@
                 auto error = retainPtr(errorNotRetain);
 #endif
                 continueAfterRequest(credential, error, WTFMove(handler));
-                weakThis->m_proxy.clear();
+                if (weakThis && weakThis->m_proxy)
+                    weakThis->m_proxy.clear();
 #if PLATFORM(MAC)
             }).get()];
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to