-
Notifications
You must be signed in to change notification settings - Fork 413
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
snmp: fix dangling pointer in snmp_traps #51
snmp: fix dangling pointer in snmp_traps #51
Conversation
With this
|
No code in snmp traverses varbinds backwards so prev is never used. This also fixes false positive dangling pointer detection by GCC.
This function is a trap :( This is not a real dangling pointer, because it is fixed afterwards, but the compiler is not smart enough to see it. original_varbinds->prev = original_prev; And I understand, because the code is terrible. There is a much bigger problem with the SNMP code. Is it ok for you to remove all This function had two dangling pointers. One was real and is fixed by the first commit, the second was false positive and is fixed by the second commit. |
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.
Can you remove the prev
pointer in struct snmp_varbind
also to make sure it isn't used?
Sure. I thing, that it is breaking change for user applications. Nobody is probably using |
Should I also add something like this to
|
I can add it for you. |
fixes: https://savannah.nongnu.org/bugs/?64685
fixes: https://savannah.nongnu.org/bugs/?64847
replaces: #42 which is wrong
replaces: #41 which is duplicate of #42