-
Notifications
You must be signed in to change notification settings - Fork 151
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
src/request.c:298: out of scope ? #88
Comments
Looks like it indeed. |
I guess I missed that when I reviewed commit da1f0fb a couple of years ago. Luckily, there are no other locals to push on the stack in that function; the only other local is a loop variable likely kept in a register by the compiler. So I don't think this is likely to actually be a problem in any realistically compiled binaries, but it definitely should be fixed. I am assuming that your compiler or whatever tool you are using to detect this error didn't find any other such problems in the code, which is at least encouraging. |
False assumption. I only gave you the most serious. Here is a warning it made: src/request.c:844]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. |
Some warnings from the compiler: src/request.c:993:77: warning: '%s' directive output may be truncated writing up to 64 bytes into a region of size between 17 and 144 [-Wformat-truncation=] |
OK I believe I fixed all in my recent commit 4f2db1e. Except this; I'm not sure my compiler showed me this one: src/request.c:844]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. |
gcc flag -Wformat-signedness will help with the last one. I used static analyser cppcheck, available from sourceforge. |
[src/request.c:293] -> [src/request.c:290] -> [src/request.c:298]: (error) Using pointer to local variable 'headerNameWithPrefix' that is out of scope.
Source code is
The text was updated successfully, but these errors were encountered: