]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed trying to uncompress after compressing in gzip direct mode which is not support...
authorNathan Moinvaziri <nathan@nathanm.com>
Thu, 27 May 2021 17:27:09 +0000 (10:27 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 30 May 2021 13:49:39 +0000 (15:49 +0200)
https://oss-fuzz.com/testcase-detail/6194422837542912

test/fuzz/minigzip_fuzzer.c

index 6703ac58ffed5e1a53bfcd3689b23f51c5baaf5f..0c7a79a7d7f48f2a7338a656acdbd7b78ec6bf59 100644 (file)
@@ -295,7 +295,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen) {
     }
 
     file_compress(inFileName, outmode);
-    file_uncompress(outFileName);
+
+    /* gzopen does not support reading in direct mode */
+    if (outmode[3] == 'T')
+        inFileName = outFileName;
+    else
+        file_uncompress(outFileName);
 
     /* Check that the uncompressed file matches the input data. */
     in = fopen(inFileName, "rb");