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 wrong path check in ImageLoaderMachO #737

Closed
wants to merge 1 commit into from

Conversation

disconnect3d
Copy link

This PR fixes a bug in strncmp(installPath, "/usr/libexec/oah/Shims", 9) - the size argument passed seems to be copied from a previous call and results in an incorrect path check as here only the "/usr/libe" prefix will be checked.

Please note that with my proposed change any directory path that starts with "/usr/libexec/oah/Shims" will be matched so "/usr/libexec/oah/ShimsSOMETHING" would also do.

I am not aware of this codebase, so maybe there should be a "/" at the end of this path?

This PR fixes a bug in `strncmp(installPath, "/usr/libexec/oah/Shims", 9)` - the size argument passed seems to be copied from a previous call and results in an incorrect path check as here only the `"/usr/libe"` prefix will be checked.

Please note that with my proposed change any directory path that starts with `"/usr/libexec/oah/Shims"` will be matched so `"/usr/libexec/oah/ShimsSOMETHING"` would also do.

I am not aware of this codebase, so maybe there should be a `"/"` at the end of this path?
@bugaevc
Copy link
Member

bugaevc commented Apr 13, 2020

Thank you for your contribution, but, no. This code comes from Apple; if they have fixed this bug in a newer version, we should update to that; if they haven't, we should leave the bug as is.

@bugaevc bugaevc closed this Apr 13, 2020
@disconnect3d
Copy link
Author

disconnect3d commented Apr 13, 2020

Good point. Reported further to opensource-apple/dyld#4.

EDIT: Sadly, this is not an official repo.

@bugaevc
Copy link
Member

bugaevc commented Apr 13, 2020

I were much doubt Apple's going to read GitHub issues; file a Radar or whatever they call it these days if you really want this addressed.

@ahyattdev
Copy link
Member

I wonder how much effort updating our dyld would be

@ahyattdev
Copy link
Member

ahyattdev commented Apr 13, 2020

One consideration: did Apple mess with i386 loading in dyld in 10.15 or is it more architecture-agnostic?

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.

3 participants