diff options
Diffstat (limited to 'src/zlib-ng/test/fuzz/minigzip_fuzzer.c')
-rw-r--r-- | src/zlib-ng/test/fuzz/minigzip_fuzzer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/zlib-ng/test/fuzz/minigzip_fuzzer.c b/src/zlib-ng/test/fuzz/minigzip_fuzzer.c index 92ccedc..7c5d3ef 100644 --- a/src/zlib-ng/test/fuzz/minigzip_fuzzer.c +++ b/src/zlib-ng/test/fuzz/minigzip_fuzzer.c @@ -13,6 +13,7 @@ */ #define _POSIX_SOURCE 1 /* This file needs POSIX for fileno(). */ +#define _POSIX_C_SOURCE 200112 /* For snprintf(). */ #include "zbuild.h" #ifdef ZLIB_COMPAT @@ -31,10 +32,6 @@ # include <sys/stat.h> #endif -#ifndef UNALIGNED_OK -# include <malloc.h> -#endif - #if defined(_WIN32) || defined(__CYGWIN__) # include <fcntl.h> # include <io.h> @@ -270,7 +267,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen) { /* Compression level: [0..9]. */ outmode[2] = data[0] % 10; - switch (data[0] % 4) { + switch (data[dataLen-1] % 6) { default: case 0: outmode[3] = 0; @@ -287,6 +284,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen) { /* compress with Z_RLE */ outmode[3] = 'R'; break; + case 4: + /* compress with Z_FIXED */ + outmode[3] = 'F'; + break; + case 5: + /* direct */ + outmode[3] = 'T'; + break; } file_compress(inFileName, outmode); |