Bug 1166349: Use a fallible allocation in nsXMLHttpRequest::StreamReaderFunc. r=smaug
This commit is contained in:
@@ -1857,8 +1857,7 @@ nsXMLHttpRequest::StreamReaderFunc(nsIInputStream* in,
|
||||
xmlHttpRequest->mResponseXML) {
|
||||
// Copy for our own use
|
||||
uint32_t previousLength = xmlHttpRequest->mResponseBody.Length();
|
||||
xmlHttpRequest->mResponseBody.Append(fromRawSegment,count);
|
||||
if (count > 0 && xmlHttpRequest->mResponseBody.Length() == previousLength) {
|
||||
if (!xmlHttpRequest->mResponseBody.Append(fromRawSegment, count, fallible)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
} else if (xmlHttpRequest->mResponseType == XML_HTTP_RESPONSE_TYPE_DEFAULT ||
|
||||
|
||||
Reference in New Issue
Block a user