Skip to content

fuzz: Fix FUZZ_malloc_rand() to return non-NULL for zero-size allocations #4403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dloidolt
Copy link

@dloidolt dloidolt commented Jun 5, 2025

This PR fixes a bug in the FUZZ_malloc_rand helper function introduced in fcaf06d.

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.

…ions

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.
@dloidolt dloidolt force-pushed the fix_FUZZ_malloc_rand branch from 29a65c6 to 4be08ba Compare June 5, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants