]> sourceware.org Git - bzip2.git/commitdiff
bzip2recover: Fix use after free issue with outFile.
authorMark Wielaard <mark@klomp.org>
Sun, 23 Jun 2019 22:45:32 +0000 (00:45 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 23 Jun 2019 22:58:47 +0000 (00:58 +0200)
bzip2recover.c (main): Make sure to set outFile to NULL when done.

This was reported as CVE-2016-3189 and found in multiple distributions.
https://seclists.org/oss-sec/2016/q2/568

Some more analysis can be found in:
https://bugzilla.redhat.com/show_bug.cgi?id=1319648

bzip2recover.c

index 1a70e04f4d2ae063bf3886c8de47073b53bfeed7..a955d60bdfcd1a4d7c936e58ec67948f8c95bf14 100644 (file)
@@ -458,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv )
             bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
             bsPutUInt32 ( bsWr, blockCRC );
             bsClose ( bsWr );
+            outFile = NULL;
          }
          if (wrBlock >= rbCtr) break;
          wrBlock++;
This page took 0.025222 seconds and 5 git commands to generate.