Skip to content

Handle failed POSIX memory mappings - #133

Open
tryk016 wants to merge 1 commit into
GothicKit:mainfrom
tryk016:fix/posix-mmap-failure
Open

tryk016 wants to merge 1 commit into
GothicKit:mainfrom
tryk016:fix/posix-mmap-failure

Conversation

@tryk016

@tryk016 tryk016 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

mmap() returns MAP_FAILED on failure, not nullptr. Check the correct value so a failed mapping throws instead of leaving Vfs with an invalid pointer. Also close the file descriptor when fstat() or mmap() fails.

Adds a regression test that rejects an unmappable path and then mounts a valid archive.

This branch has not been deployed

No deployments
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.

1 participant