mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
b=873757; crash in JSStructuredCloneWriter::writeArrayBuffer; r=bz
This commit is contained in:
parent
262e16d802
commit
7b3cd12107
@ -3466,6 +3466,7 @@ nsXMLHttpRequest::MaybeDispatchProgressEvents(bool aFinalProgress)
|
||||
mResponseBody.Truncate();
|
||||
mResponseText.Truncate();
|
||||
mResultArrayBuffer = nullptr;
|
||||
mArrayBufferBuilder.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1064,7 +1064,9 @@ class ArrayBufferBuilder
|
||||
}
|
||||
|
||||
JSObject* getArrayBuffer(JSContext *cx) {
|
||||
if (capacity_ > length_) {
|
||||
// we need to check for length_ == 0, because nothing may have been
|
||||
// added
|
||||
if (capacity_ > length_ || length_ == 0) {
|
||||
if (!setCapacity(length_))
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user