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

headernt.c: fix segmentation fault when runtime not found #12726

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

nojb
Copy link
Contributor

@nojb nojb commented Nov 9, 2023

Fixes a segmentation fault under Windows when the runtime (ocamlrun.exe) is not found in the PATH.

The bug and the fix were identified by @vadim-z. @dra27 had a similar fix in one of his working branches as well.

Fixes #12722

@nojb nojb requested a review from dra27 November 9, 2023 14:12
Copy link
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MSDN documentation for SearchPathW doesn't make it explicit that NULL can be passed, but it does list lpFilePart as being optional.

I wonder whether in the past it wasn't quite this optional, but I ran this PR locally (on Windows 10) and it appears to behave as expected.

@dra27 dra27 merged commit 22e7c76 into ocaml:trunk Nov 10, 2023
9 checks passed
@nojb nojb deleted the fix_headernt branch November 10, 2023 10:39
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.

NULL dereference in the "header" stub of bytecode executables for Windows
2 participants