Bug 1193572, part 2 - nsXULPrototypeElement::Deserialize should use fallible SetCapacity. r=baku

I think this prevents a crash if we end up with a bogus cache value.
This commit is contained in:
Andrew McCreight 2015-08-13 14:24:59 -07:00
parent e75d7d53b5
commit 4a99525af2

View File

@ -2318,7 +2318,9 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream,
uint32_t numChildren = int32_t(number);
if (numChildren > 0) {
mChildren.SetCapacity(numChildren);
if (!mChildren.SetCapacity(numChildren, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
for (uint32_t i = 0; i < numChildren; i++) {
rv = aStream->Read32(&number);