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

Check return values from FindNode for null pointers #228

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

cassiebeckley
Copy link
Contributor

Fixes #227

Copy link
Contributor

@chaoticbob chaoticbob left a comment

Choose a reason for hiding this comment

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

Looks good overall, just one small change.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is not a valid SPIR-V if using spirv-val

seems it has GLSL.std.453

after I see

%21 = OpAccessChain %20 %_ %19

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is invalid, I included it specifically as a regression test since it triggers the null pointer dereference. I suspect any SPIR-V that triggers the error will be invalid, since it requires a reference to a node that doesn't exist.

This SPIR-V file is the one that was included in the original report of this issue; I suspect the reporter generated it using a fuzzer. I can try to clean it up more if you think that would be better.

I mention the issues with this file in README.md.

Copy link
Contributor

Choose a reason for hiding this comment

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

That is fair

@cassiebeckley
Copy link
Contributor Author

Looks good overall, just one small change.

@chaoticbob what did you want me to change? I don't think it's showing up for me.

@chaoticbob
Copy link
Contributor

Looks good overall, just one small change.

@chaoticbob what did you want me to change? I don't think it's showing up for me.

One of the comments was to add parens around the right hand side of a logical expressions.

@cassiebeckley
Copy link
Contributor Author

Okay, fixed that. Anything else?

Copy link
Contributor

@chaoticbob chaoticbob left a comment

Choose a reason for hiding this comment

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

LGTM

@cassiebeckley cassiebeckley merged commit 3f46812 into KhronosGroup:main Oct 12, 2023
4 checks passed
@cassiebeckley cassiebeckley deleted the null-dereference branch October 12, 2023 18:24
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 pointer dereference
3 participants