-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Fix GH-17330: SNMP::setSecurity segfaults when object had been closed. #17337
Conversation
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.
Isn't this an issue for other methods too?
ext/snmp/snmp.c
Outdated
@@ -87,6 +87,13 @@ typedef struct snmp_session php_snmp_session; | |||
} \ | |||
} | |||
|
|||
#define PHP_SNMP_FETCH_OBJECT \ |
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.
I would prefer a macro function rather than assume the name of the variable
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.
I'm also not a big fan of these obscure macros, and given that we need it only once for now, I would suggest to inline it in ::setSecurity()
.
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.
in fact I was waiting feedback on the close() comment.
No, e.g. getErr* do not need at all the session part. see also the close comment, we could do it there but can be a BC. |
…sed. checking when the workflow needs to deal with an existing SNMP session.
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.
Good for me. Thank you! Maybe @Girgias wants to check again.
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.
LGTM
having new macro when the workflow needs to deal with an existing SNMP session.