Bug 1215745: Safer implemetation of nsJarChannel::AsyncOpen2. r=ckerschb

This commit is contained in:
Jonas Sicking 2015-10-18 20:20:29 -07:00
parent c0d2ada691
commit a7059223c3

View File

@ -989,15 +989,10 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx)
NS_IMETHODIMP
nsJARChannel::AsyncOpen2(nsIStreamListener *aListener)
{
if (!mLoadInfo) {
MOZ_ASSERT(mLoadInfo, "can not enforce security without loadInfo");
return NS_ERROR_UNEXPECTED;
}
// setting the flag on the loadInfo indicates that the underlying
// channel will be openend using AsyncOpen2() and hence performs
// the necessary security checks.
mLoadInfo->SetEnforceSecurity(true);
return AsyncOpen(aListener, nullptr);
nsCOMPtr<nsIStreamListener> listener = aListener;
nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
NS_ENSURE_SUCCESS(rv, rv);
return AsyncOpen(listener, nullptr);
}
nsresult