diff options
author | Nathan Moinvaziri <nathan@nathanm.com> | 2021-05-27 10:27:09 -0700 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2021-05-30 15:49:39 +0200 |
commit | 59306efa92411d7d70e1be5fa6c600a2f994bb0f (patch) | |
tree | ccd0f14e95b5c2dfc3acc050d80da1872cb72464 | |
parent | 634e01d76dc18ed92b6f4b659543e10bc871b045 (diff) |
Fixed trying to uncompress after compressing in gzip direct mode which is not supported by gz functions.
https://oss-fuzz.com/testcase-detail/6194422837542912
-rw-r--r-- | test/fuzz/minigzip_fuzzer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/fuzz/minigzip_fuzzer.c b/test/fuzz/minigzip_fuzzer.c index 6703ac5..0c7a79a 100644 --- a/test/fuzz/minigzip_fuzzer.c +++ b/test/fuzz/minigzip_fuzzer.c @@ -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"); |