Skip to content

Conversation

@richardsonnick
Copy link

According to the mmap docs MAP_FAILED is returned upon error:

On success, mmap() returns a pointer to the mapped area. On
error, the value MAP_FAILED (that is, (void *) -1) is returned,
and errno is set to indicate the error.

Update mmap error validation to check for MAP_FAILED instead of NULL. POSIX specifies that mmap returns MAP_FAILED (-1) on failure.

Reported-by: Clang 21 Static Analyzer

Update mmap error validation to check for MAP_FAILED instead of NULL.
POSIX specifies that mmap returns MAP_FAILED (-1) on failure.
@meta-cla meta-cla bot added the CLA Signed label Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant