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 os_path_join for case where dirname is empty #1158

Merged
merged 1 commit into from Jun 26, 2018

Conversation

isaachier
Copy link
Contributor

No description provided.

@isaachier
Copy link
Contributor Author

Saw an issue here when I ran the fuzz test. When dirname is empty, c sets itself to buf_ptr(dirname) + 0 - 1, which accesses out-of-bounds memory.

Copy link
Contributor

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM. Calling zig_panic() would perhaps also have been appropriate since an empty dirname is likely indicative of a bug.

Is there a way to turn fuzz test crashes into regression tests?

@isaachier
Copy link
Contributor Author

Probably easier to just write the regression test by hand. Fuzz test will easily reproduce the error, but better to catch this in regular testing cycle.

@andrewrk andrewrk merged commit 8e71428 into ziglang:master Jun 26, 2018
@andrewrk
Copy link
Member

thanks!

@isaachier isaachier deleted the os-join-empty-path-fix branch June 26, 2018 17:49
@isaachier
Copy link
Contributor Author

Anytime

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.

None yet

3 participants