Check rv before looking at port. Bug 334210, r+sr+branch181=jst

This commit is contained in:
bzbarsky%mit.edu 2006-04-17 23:19:44 +00:00
Родитель af606bbad8
Коммит dffe9c89ad
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -330,10 +330,14 @@ nsScriptSecurityManager::SecurityCompareURIs(nsIURI* aSourceURI,
// If the port comparison failed, see if either URL has a
// port of -1. If so, replace -1 with the default port
// for that scheme.
if (!*result && (sourcePort == -1 || targetPort == -1))
if (NS_SUCCEEDED(rv) && !*result &&
(sourcePort == -1 || targetPort == -1))
{
NS_ENSURE_STATE(sIOService);
NS_ASSERTION(targetScheme.Equals(sourceScheme),
"Schemes should be equal here");
PRInt32 defaultPort;
nsCOMPtr<nsIProtocolHandler> protocolHandler;
rv = sIOService->GetProtocolHandler(sourceScheme.get(),