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
libexpr: Make unsafeGetAttrPos not crash on noPos #2010
Conversation
Not sure what's the best fix here, just picked one. |
I have a mild preference for |
I did think of
which will then blow up on |
It should IMO 😀 |
Less facetiously: What is the "right" behavior for that code in the noPos case? |
Well I don't think
|
If you're doing that check then why not just check for null (or attr non-existence?) |
Oh I had somehow misinterpreted that question as returning IMHO the problem of
with the expectation that |
|
Currently e.g. `builtins.unsafeGetAttrPos "abort" builtins` will eventually segfault because pos->file is an unset Symbol. Found by afl-fuzz.
Throwing an exception sounds pretty inconsistent given that the function already returns I guess returning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. @edolstra ?
Currently e.g.
builtins.unsafeGetAttrPos "path" builtins
willeventually segfault because pos->file is an unset Symbol.
Found by afl-fuzz.