Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4e1bd28

Browse files
embghswong3i
authored andcommittedJan 5, 2025
fix -Werror=pointer-arith in fuzzers (facebook#3983)
1 parent e5b18b8 commit 4e1bd28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎tests/fuzz/decompress_cross_format.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
2727
// The rest will be interpreted as magicless compressed data.
2828
FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(src, size);
2929
size_t magiclessSize = FUZZ_dataProducer_reserveDataPrefix(producer);
30-
const void* const magiclessSrc = src;
30+
const uint8_t* const magiclessSrc = src;
3131
size_t const dstSize = FUZZ_dataProducer_uint32Range(producer, 0, 10 * size);
32-
void* const standardDst = FUZZ_malloc(dstSize);
33-
void* const magiclessDst = FUZZ_malloc(dstSize);
32+
uint8_t* const standardDst = (uint8_t*)FUZZ_malloc(dstSize);
33+
uint8_t* const magiclessDst = (uint8_t*)FUZZ_malloc(dstSize);
3434

3535
// Create standard-format src from magicless-format src
3636
const uint32_t zstd_magic = ZSTD_MAGICNUMBER;
3737
size_t standardSize = sizeof(zstd_magic) + magiclessSize;
38-
void* const standardSrc = FUZZ_malloc(standardSize);
38+
uint8_t* const standardSrc = (uint8_t*)FUZZ_malloc(standardSize);
3939
memcpy(standardSrc, &zstd_magic, sizeof(zstd_magic)); // assume fuzzing on little-endian machine
4040
memcpy(standardSrc + sizeof(zstd_magic), magiclessSrc, magiclessSize);
4141

0 commit comments

Comments
 (0)
Please sign in to comment.