зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ca1c853c7d
Коммит
f248610a58
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче