} \
}
-static const uint8_t *data;
-static size_t dataLen;
static alloc_func zalloc = NULL;
static free_func zfree = NULL;
static unsigned int diff;
}
int LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {
+ Z_UNUSED(d);
size_t comprLen = 100 + 3 * size;
size_t uncomprLen = comprLen;
uint8_t *compr, *uncompr;
if (size < 1 || size > kMaxSize)
return 0;
- data = d;
- dataLen = size;
compr = (uint8_t *)calloc(1, comprLen);
uncompr = (uint8_t *)calloc(1, uncomprLen);
fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n");
GTEST_SKIP();
#else
- uint8_t compr[128], uncompr[128];
- uint32_t compr_len = sizeof(compr), uncompr_len = sizeof(uncompr);
- size_t read;
+ uint8_t uncompr[128];
+ uint32_t compr_len, uncompr_len = sizeof(uncompr);
int64_t pos;
gzFile file;
int err;
- Z_UNUSED(compr);
/* Write gz file with test data */
file = PREFIX(gzopen)(TESTFILE, "wb");
ASSERT_TRUE(file != NULL);
EXPECT_EQ(PREFIX(gzeof)(file), 0);
/* Read first hello, hello! string with gzfread */
strcpy((char*)uncompr, "garbages");
- read = PREFIX(gzfread)(uncompr, uncompr_len, 1, file);
+ PREFIX(gzfread)(uncompr, uncompr_len, 1, file);
EXPECT_STREQ((const char *)uncompr, hello);
pos = PREFIX(gzoffset)(file);
PREFIX(gzclose)(file);
EXPECT_EQ(PREFIX(gzclose)(NULL), Z_STREAM_ERROR);
- Z_UNUSED(read);
#endif
}