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 500480 379d79841c5d439654d77f264f7c9d730863059e
parent 500431 0ff0b54b9ec7c3e99acf8987b63995dbdce3e64a
child 500481 e87d7028568e721e8d297ce62f9622e74d29bb37
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [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 */