Skip to content
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

fix: check mmap result #2003

Merged
merged 3 commits into from
Nov 15, 2023
Merged

fix: check mmap result #2003

merged 3 commits into from
Nov 15, 2023

Conversation

secDre4mer
Copy link
Contributor

Check if mmap failed (return value MAP_FAILED) and, if yes, exit.

Check if mmap failed (return value MAP_FAILED) and, if yes, exit.
@secDre4mer secDre4mer marked this pull request as ready for review November 13, 2023 16:52
@secDre4mer
Copy link
Contributor Author

In addition to the original fix, improved the behaviour: if mmap on a file fails, it now falls back to an anonymous mmap() followed by pread(), same as if the file couldn't be opened. Thanks to @hillu for this idea.

@plusvic plusvic merged commit 1256631 into VirusTotal:master Nov 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants