Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

correct mmap error check#4560

Open
richardsonnick wants to merge 1 commit intofacebook:dev from
richardsonnick:fix-mmap-null-check
Open

correct mmap error check #4560
richardsonnick wants to merge 1 commit intofacebook:dev from
richardsonnick:fix-mmap-null-check

Conversation

@richardsonnick
Copy link

@richardsonnick richardsonnick commented Dec 23, 2025

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /