Bug 1624325 - Make CreateZipItem allocation fallible r=valentin
authoranjali1903 <anjali.jha1903@gmail.com>
Wed, 25 Mar 2020 16:11:07 +0000
changeset 520398 9a57a9e14892fac10129a67a2cbc64c45f458830
parent 520397 3532b2cd85cac8b4b0fd946b2f23415ebe060d7a
child 520399 081cfce87dbe4ee41e6b56f925a292e5640e7e57
push id37249
push userdvarga@mozilla.com
push dateWed, 25 Mar 2020 21:39:06 +0000
treeherdermozilla-central@b3c3f7d0f044 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1624325
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1624325 - Make CreateZipItem allocation fallible r=valentin Differential Revision: https://phabricator.services.mozilla.com/D68214
modules/libjar/nsZipArchive.cpp
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -636,17 +636,17 @@ nsresult nsZipFind::FindNext(const char*
 //      nsZipArchive  --  private implementation
 //***********************************************************
 
 //---------------------------------------------
 //  nsZipArchive::CreateZipItem
 //---------------------------------------------
 nsZipItem* nsZipArchive::CreateZipItem() {
   // Arena allocate the nsZipItem
-  return (nsZipItem*)mArena.Allocate(sizeof(nsZipItem));
+  return (nsZipItem*)mArena.Allocate(sizeof(nsZipItem), mozilla::fallible);
 }
 
 //---------------------------------------------
 //  nsZipArchive::BuildFileList
 //---------------------------------------------
 nsresult nsZipArchive::BuildFileList(PRFileDesc* aFd) {
   // Get archive size using end pos
   const uint8_t* buf;