diff options
author | Elliot Gorokhovsky <embg@fb.com> | 2024-03-21 15:16:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-21 15:16:38 -0400 |
commit | dc1f7b560b23f5bd50a0fcddd677007c9c76ec0b (patch) | |
tree | 70cacedc09a631b47192de7b1f55b310feee56eb | |
parent | 6679d0ca7b9eb9a6ed90997006d5086ce89a7e18 (diff) | |
download | zstd-dc1f7b560b23f5bd50a0fcddd677007c9c76ec0b.tar.gz |
fix -Werror=pointer-arith in fuzzers (#3983)
-rw-r--r-- | tests/fuzz/decompress_cross_format.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/fuzz/decompress_cross_format.c b/tests/fuzz/decompress_cross_format.c index 78461e69..da10702a 100644 --- a/tests/fuzz/decompress_cross_format.c +++ b/tests/fuzz/decompress_cross_format.c @@ -27,15 +27,15 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size) // The rest will be interpreted as magicless compressed data. FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(src, size); size_t magiclessSize = FUZZ_dataProducer_reserveDataPrefix(producer); - const void* const magiclessSrc = src; + const uint8_t* const magiclessSrc = src; size_t const dstSize = FUZZ_dataProducer_uint32Range(producer, 0, 10 * size); - void* const standardDst = FUZZ_malloc(dstSize); - void* const magiclessDst = FUZZ_malloc(dstSize); + uint8_t* const standardDst = (uint8_t*)FUZZ_malloc(dstSize); + uint8_t* const magiclessDst = (uint8_t*)FUZZ_malloc(dstSize); // Create standard-format src from magicless-format src const uint32_t zstd_magic = ZSTD_MAGICNUMBER; size_t standardSize = sizeof(zstd_magic) + magiclessSize; - void* const standardSrc = FUZZ_malloc(standardSize); + uint8_t* const standardSrc = (uint8_t*)FUZZ_malloc(standardSize); memcpy(standardSrc, &zstd_magic, sizeof(zstd_magic)); // assume fuzzing on little-endian machine memcpy(standardSrc + sizeof(zstd_magic), magiclessSrc, magiclessSize); |