mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 00:02:37 +00:00
Bug 1330273 - Add some security checks about the use of the string buffer in FileReader, r=bkelly
This commit is contained in:
parent
359ae91eac
commit
d717bea267
@ -333,6 +333,7 @@ FileReader::DoReadData(uint64_t aCount)
|
||||
}
|
||||
|
||||
uint32_t bytesRead = 0;
|
||||
MOZ_DIAGNOSTIC_ASSERT(mFileData);
|
||||
mAsyncStream->Read(mFileData + mDataLen, aCount, &bytesRead);
|
||||
MOZ_ASSERT(bytesRead == aCount, "failed to read data");
|
||||
}
|
||||
@ -731,14 +732,16 @@ FileReader::Notify(Status aStatus)
|
||||
void
|
||||
FileReader::Shutdown()
|
||||
{
|
||||
FreeFileData();
|
||||
mResultArrayBuffer = nullptr;
|
||||
mReadyState = DONE;
|
||||
|
||||
if (mAsyncStream) {
|
||||
mAsyncStream->Close();
|
||||
mAsyncStream = nullptr;
|
||||
}
|
||||
|
||||
FreeFileData();
|
||||
mResultArrayBuffer = nullptr;
|
||||
|
||||
if (mWorkerPrivate && mBusyCount != 0) {
|
||||
ReleaseWorker();
|
||||
mWorkerPrivate = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user