Skip to content

Fix GH-21336: undefined behavior in snmp setSecurity.#21337

Open
devnexen wants to merge 1 commit intophp:PHP-8.4from
devnexen:gh21336
Open

Fix GH-21336: undefined behavior in snmp setSecurity.#21337
devnexen wants to merge 1 commit intophp:PHP-8.4from
devnexen:gh21336

Conversation

@devnexen
Copy link
Member

@devnexen devnexen commented Mar 4, 2026

No description provided.

@devnexen devnexen marked this pull request as ready for review March 4, 2026 05:57
@devnexen devnexen linked an issue Mar 4, 2026 that may be closed by this pull request
Comment on lines 962 to +967
static bool netsnmp_session_set_auth_protocol(struct snmp_session *s, zend_string *prot)
{
if (!prot) {
zend_value_error("Authentication protocol can't be NULL");
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

Considering these are static functions I'd rather use ZEND_ATTRIBUTE_NONNULL and check this on the call site as an error message indicating something cannot be a NULL pointer is useless from a PHP user PoV.

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.

undefined behavior in snmp

2 participants