Bug 1153929 - Add assertions and null checks to fix windows crash in nsHttpTransaction r=mcmanus

This commit is contained in:
Valentin Gosu 2015-05-08 03:54:06 +03:00
Родитель 550cacb4e3
Коммит b4379aa7b4
1 изменённых файлов: 12 добавлений и 0 удалений

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

@ -728,6 +728,12 @@ nsHttpTransaction::WritePipeSegment(nsIOutputStream *stream,
trans->SetResponseStart(TimeStamp::Now(), true);
}
// Bug 1153929 - add checks to fix windows crash
MOZ_ASSERT(trans->mWriter);
if (!trans->mWriter) {
return NS_ERROR_UNEXPECTED;
}
nsresult rv;
//
// OK, now let the caller fill this segment with data.
@ -768,6 +774,12 @@ nsHttpTransaction::WriteSegments(nsAHttpSegmentWriter *writer,
mWriter = writer;
// Bug 1153929 - add checks to fix windows crash
MOZ_ASSERT(mPipeOut);
if (!mPipeOut) {
return NS_ERROR_UNEXPECTED;
}
nsresult rv = mPipeOut->WriteSegments(WritePipeSegment, this, count, countWritten);
mWriter = nullptr;