Bug 394525 - "malware check non-http URIs" (treat Suspend() failures as nonfatal) [p=dcamp r=bzbarsky sr=biesi a=blocking1.9+]
git-svn-id: svn://10.0.0.236/trunk@239289 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2b928ebc40
commit
41502a32b2
@ -9201,12 +9201,25 @@ nsClassifierCallback::Run()
|
|||||||
nsresult rv = channel->GetURI(getter_AddRefs(uri));
|
nsresult rv = channel->GetURI(getter_AddRefs(uri));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// XXX: we need to audit other channels to make sure they can handle
|
// Don't bother checking certain types of URIs.
|
||||||
// being suspended directly after AsyncOpen()
|
PRBool hasFlags;
|
||||||
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(channel);
|
rv = NS_URIChainHasFlags(uri,
|
||||||
if (!httpChannel) {
|
nsIProtocolHandler::URI_DANGEROUS_TO_LOAD,
|
||||||
return NS_OK;
|
&hasFlags);
|
||||||
}
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
if (hasFlags) return NS_OK;
|
||||||
|
|
||||||
|
rv = NS_URIChainHasFlags(uri,
|
||||||
|
nsIProtocolHandler::URI_IS_LOCAL_FILE,
|
||||||
|
&hasFlags);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
if (hasFlags) return NS_OK;
|
||||||
|
|
||||||
|
rv = NS_URIChainHasFlags(uri,
|
||||||
|
nsIProtocolHandler::URI_IS_UI_RESOURCE,
|
||||||
|
&hasFlags);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
if (hasFlags) return NS_OK;
|
||||||
|
|
||||||
nsCOMPtr<nsIURIClassifier> uriClassifier =
|
nsCOMPtr<nsIURIClassifier> uriClassifier =
|
||||||
do_GetService(NS_URICLASSIFIERSERVICE_CONTRACTID, &rv);
|
do_GetService(NS_URICLASSIFIERSERVICE_CONTRACTID, &rv);
|
||||||
@ -9220,7 +9233,13 @@ nsClassifierCallback::Run()
|
|||||||
// Suspend the channel, it will be resumed when we get the classifier
|
// Suspend the channel, it will be resumed when we get the classifier
|
||||||
// callback.
|
// callback.
|
||||||
rv = channel->Suspend();
|
rv = channel->Suspend();
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
if (NS_FAILED(rv)) {
|
||||||
|
// Some channels (including nsJSChannel) fail on Suspend. This
|
||||||
|
// shouldn't be fatal, but will prevent malware from being
|
||||||
|
// blocked on these channels.
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
mSuspendedChannel = channel;
|
mSuspendedChannel = channel;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
|
PR_LOG(gDocShellLog, PR_LOG_DEBUG,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user