Bug 504170 nsAStreamCopier::Process can use sourceCondition, sinkCondition uninitialized if someone cancels the copy early

r=dougt
This commit is contained in:
timeless@mozdev.org 2009-08-12 11:49:52 +02:00
parent a5db807132
commit 18ff2518cc

View File

@ -388,12 +388,17 @@ public:
// notify state complete...
if (mCallback) {
nsresult status = sourceCondition;
if (NS_SUCCEEDED(status))
status = sinkCondition;
if (status == NS_BASE_STREAM_CLOSED)
status = NS_OK;
mCallback(mClosure, canceled ? cancelStatus : status);
nsresult status;
if (!canceled) {
status = sourceCondition;
if (NS_SUCCEEDED(status))
status = sinkCondition;
if (status == NS_BASE_STREAM_CLOSED)
status = NS_OK;
} else {
status = cancelStatus;
}
mCallback(mClosure, status);
}
break;
}