-
Notifications
You must be signed in to change notification settings - Fork 56
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
Possible NULL pointer dereference #149
Comments
It looks like you are calling fctprintf() with a NULL instead of your output function. Is it your intention to discard the output? |
I'm not actually calling anything yet. This is generated by the GCC 12.2Rel1 when it is doing its analysis of the I think that the underlying issue is that the |
Hmm. So, the assignment into a NULL buffer can happen if the function gadget was created with a NULL function pointer. This only happens if the user invoked So, basically - it's not a bug, just a potential foot-gun, which is a design decision older than my involvement in this project. |
It also prevents compiling on GCC 12.2Rel1 with The warning goes away if I check the |
@Rob-McKay : Is there a preprocessor macro which I can use to identify this compiler? Because GCC 12.2 on x86_64 doesn't complain about the issue. If I could pin down your compiler, I could add a warning suppression at that line. |
The issue is a excessive warning with your compiler. I'll be happy to take a PR to address that issue - but certainly not to hurt performance in the innermost loop. |
@eyalroz: I have found out what causes GCC to generate the warning. If you add the |
So, let me just add an outer check in |
…ive up immediately and avoid NULL-dereferencing situations (which GCC's static analyzer complains about)
…ive up immediately and avoid NULL-dereferencing situations (which GCC's static analyzer complains about)
…nter, give up immediately and avoid NULL-dereferencing situations (which GCC's static analyzer complains about)
Hi,
When I build printf with GCC 12.2 from ARM I get the following error
The text was updated successfully, but these errors were encountered: