Bug 1458129 - Prevent double free in mar_sign.c. r=rstrong
authorJune Wilde <jewilde@mozilla.com>
Thu, 18 Oct 2018 13:29:08 -0400
changeset 497769 379d79841c5d439654d77f264f7c9d730863059e
parent 497720 0ff0b54b9ec7c3e99acf8987b63995dbdce3e64a
child 497770 e87d7028568e721e8d297ce62f9622e74d29bb37
push id10002
push userarchaeopteryx@coole-files.de
push dateFri, 19 Oct 2018 23:09:29 +0000
treeherdermozilla-beta@01378c910610 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs1458129
milestone64.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 1458129 - Prevent double free in mar_sign.c. r=rstrong Differential Revision: https://phabricator.services.mozilla.com/D8924
modules/libmar/sign/mar_sign.c
--- a/modules/libmar/sign/mar_sign.c
+++ b/modules/libmar/sign/mar_sign.c
@@ -529,16 +529,17 @@ extract_signature(const char *src, uint3
     fprintf(stderr, "ERROR: Signature index was out of range\n");
     goto failure;
   }
 
   /* Skip to the correct signature */
   for (i = 0; i <= sigIndex; i++) {
     /* Avoid leaking while skipping signatures */
     free(extractedSignature);
+    extractedSignature = NULL;
 
     /* skip past the signature algorithm ID */
     if (fseeko(fpSrc, sizeof(uint32_t), SEEK_CUR)) {
       fprintf(stderr, "ERROR: Could not seek past sig algorithm ID.\n");
       goto failure;
     }
 
     /* Get the signature length */