Skip to content

fix: close fd 0 when mmap fails - #1924

Open
fallintoplace wants to merge 1 commit into
getsentry:masterfrom
fallintoplace:fix/close-fd-zero-mmap-failure
Open

fix: close fd 0 when mmap fails#1924
fallintoplace wants to merge 1 commit into
getsentry:masterfrom
fallintoplace:fix/close-fd-zero-mmap-failure

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

When stdin is closed, open() can return file descriptor 0. The failure cleanup in sentry__mmap_file only closed descriptors greater than 0, which leaked the file descriptor if a later step failed.

Close every non-negative descriptor and add a Linux regression test that exercises the empty-file failure path with stdin closed.

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