]> git.ipfire.org Git - thirdparty/zstd.git/commit
fuzz: Fix FUZZ_malloc_rand() to return non-NULL for zero-size allocations 4403/head
authorDominik Loidolt <dominik.loidolt@univie.ac.at>
Thu, 5 Jun 2025 13:36:29 +0000 (15:36 +0200)
committerDominik Loidolt <dominik.loidolt@univie.ac.at>
Thu, 5 Jun 2025 15:28:30 +0000 (17:28 +0200)
commit4be08ba12283ca60b3704002c3c761047eec879c
treea442d892ceb9b7a064a879b3a0d55204b96b63c9
parentbd894054c0789bbdc31845aa0a863734b03866ce
fuzz: Fix FUZZ_malloc_rand() to return non-NULL for zero-size allocations

The FUZZ_malloc_rand() function was incorrectly always returning NULL for
zero-size allocations. The random offset generated by
FUZZ_dataProducer_int32Range() was not being added to the pointer variable,
causing the function to always return (void *)0.
tests/fuzz/fuzz_helpers.c
tests/fuzz/fuzz_helpers.h