Skip to content

Fix GH-23453: bad free with a context engine ID longer than 32 bytes - #23456

Open
lazerg wants to merge 2 commits into
php:PHP-8.4from
lazerg:fix/gh-23453-snmp-context-engine-id
Open

Fix GH-23453: bad free with a context engine ID longer than 32 bytes#23456
lazerg wants to merge 2 commits into
php:PHP-8.4from
lazerg:fix/gh-23453-snmp-context-engine-id

Conversation

@lazerg

@lazerg lazerg commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

netsnmp_session_set_contextEngineID() passes an emalloc()'d buffer to snmp_hex_to_binary() with allow_realloc set. A context engine ID longer than the 32-byte buffer makes net-snmp call snmp_realloc() on that pointer, which aborts the process.

RFC 3411 caps the engine ID at 32 bytes anyway, so this drops allow_realloc: an oversized value now hits the existing "Bad engine ID value" warning and returns false.

Fixes GH-23453

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.

1 participant