From cab1c12106d8ec05047fd00d3ca32fcd5a958d6b Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 21 Nov 2017 13:24:32 +0100 Subject: Explicitly cancel channel after mixed content redirect. --- dom/security/nsMixedContentBlocker.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dom/security') diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index a9aca53334..4e80dce3f6 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -337,7 +337,11 @@ nsMixedContentBlocker::AsyncOnChannelRedirect(nsIChannel* aOldChannel, nullptr, // aExtra requestingPrincipal, &decision); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(rv)) { + autoCallback.DontCallback(); + aOldChannel->Cancel(NS_ERROR_DOM_BAD_URI); + return NS_BINDING_FAILED; + } if (nsMixedContentBlocker::sSendHSTSPriming) { // The LoadInfo passed in is for the original channel, HSTS priming needs to @@ -358,6 +362,7 @@ nsMixedContentBlocker::AsyncOnChannelRedirect(nsIChannel* aOldChannel, // If the channel is about to load mixed content, abort the channel if (!NS_CP_ACCEPTED(decision)) { autoCallback.DontCallback(); + aOldChannel->Cancel(NS_ERROR_DOM_BAD_URI); return NS_BINDING_FAILED; } -- cgit v1.2.3