Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Jan 3, 2025

having new macro when the workflow needs to deal with an existing SNMP session.

@devnexen devnexen linked an issue Jan 3, 2025 that may be closed by this pull request
Copy link
Member

@Girgias Girgias left a 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 \
Copy link
Member

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

Copy link
Member

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().

Copy link
Member Author

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.

@devnexen
Copy link
Member Author

devnexen commented Jan 3, 2025

Isn't this an issue for other methods too?

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.

@devnexen devnexen requested a review from cmb69 January 5, 2025 07:20
ext/snmp/snmp.c Outdated Show resolved Hide resolved
…sed.

checking when the workflow needs to deal with an existing SNMP session.
Copy link
Member

@cmb69 cmb69 left a 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.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devnexen devnexen closed this in cd44814 Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

snmp SEGV
3 participants