From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- security/manager/ssl/SSLServerCertVerification.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'security/manager/ssl/SSLServerCertVerification.cpp') diff --git a/security/manager/ssl/SSLServerCertVerification.cpp b/security/manager/ssl/SSLServerCertVerification.cpp index 1a0c669579..11e8db90da 100644 --- a/security/manager/ssl/SSLServerCertVerification.cpp +++ b/security/manager/ssl/SSLServerCertVerification.cpp @@ -765,6 +765,9 @@ SSLServerCertVerificationJob::Run() { RefPtr certVerifier(GetDefaultCertVerifier()); if (!certVerifier) { PR_SetError(SEC_ERROR_NOT_INITIALIZED, 0); + // We can't release this off the STS thread because some parts of it + // are not threadsafe. Just leak the mResultTask + Unused << mResultTask.forget(); return NS_OK; } @@ -1075,6 +1078,11 @@ void SSLServerCertVerificationResult::Dispatch( nsCOMPtr stsTarget = do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv); MOZ_ASSERT(stsTarget, "Failed to get socket transport service event target"); + if (!stsTarget) { + // This has to be released on STS; just leak it + Unused << mSocketControl.forget(); + return; + } rv = stsTarget->Dispatch(this, NS_DISPATCH_NORMAL); MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed to dispatch SSLServerCertVerificationResult"); -- cgit v1.2.3