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 SIGSEV crashes by adding NULL pointer checks #39

Merged
merged 8 commits into from
Oct 20, 2023

Conversation

infeo
Copy link
Member

@infeo infeo commented Oct 19, 2023

According to the fuse 3.x documentation, the methods releasedir, getattr, chmod, chown, fsyncdir, truncate and utimens can have NULL parameter. Before this PR this was not accounted for, leading to crashes of the JVM.

This PR fixes it. If the MemorySegment handed over to the JVM is the NULL-Pointer, the methods translate it to Javas null value.

@infeo infeo requested a review from overheadhunter October 19, 2023 11:41
@infeo infeo self-assigned this Oct 19, 2023
@infeo infeo added this to the 0.6.3 milestone Oct 19, 2023
Copy link
Member

@overheadhunter overheadhunter left a comment

Choose a reason for hiding this comment

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

What about fi in macOS? Is it always non-null in fuse 2?

@overheadhunter
Copy link
Member

Also, can you add tests for the new utility methods?

@infeo
Copy link
Member Author

infeo commented Oct 19, 2023

What about fi in macOS? Is it always non-null in fuse 2?

In fuse 2 the above methods either do not have a file info as parameter or the documentation only mentions the path to be nullable.

@infeo
Copy link
Member Author

infeo commented Oct 19, 2023

Also, can you add tests for the new utility methods?

@overheadhunter Done in c3bb154

@infeo infeo requested a review from overheadhunter October 19, 2023 15:04
@infeo infeo merged commit 006b4c2 into develop Oct 20, 2023
7 checks passed
@infeo infeo deleted the feature/dont-resolve-null-pointers branch October 20, 2023 10:31
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.

2 participants