Bug 290197 unchecked outputstream [@ nsXULPrototypeScript::Serialize]
r=bz sr=bz a=shaver git-svn-id: svn://10.0.0.236/trunk@173949 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -3374,7 +3374,7 @@ nsXULPrototypeScript::SerializeOutOfLine(nsIObjectOutputStream* aStream,
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (!fastLoadService)
|
||||
return rv;
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
nsCAutoString urispec;
|
||||
rv = mSrcURI->GetAsciiSpec(urispec);
|
||||
@@ -3383,15 +3383,23 @@ nsXULPrototypeScript::SerializeOutOfLine(nsIObjectOutputStream* aStream,
|
||||
|
||||
PRBool exists = PR_FALSE;
|
||||
fastLoadService->HasMuxedDocument(urispec.get(), &exists);
|
||||
/* return will be NS_OK from GetAsciiSpec.
|
||||
* that makes no sense.
|
||||
* nor does returning NS_OK from HasMuxedDocument.
|
||||
* XXX return something meaningful.
|
||||
*/
|
||||
if (exists)
|
||||
return rv;
|
||||
return NS_OK;
|
||||
|
||||
// Allow callers to pass null for aStream, meaning
|
||||
// "use the FastLoad service's default output stream."
|
||||
// See nsXULDocument.cpp for one use of this.
|
||||
nsCOMPtr<nsIObjectOutputStream> objectOutput = aStream;
|
||||
if (! objectOutput)
|
||||
if (! objectOutput) {
|
||||
fastLoadService->GetOutputStream(getter_AddRefs(objectOutput));
|
||||
if (! objectOutput)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
rv = fastLoadService->
|
||||
StartMuxedDocument(mSrcURI, urispec.get(),
|
||||
|
||||
Reference in New Issue
Block a user