[php-src] Issue #21336: undefined behavior in snmp
| From: | chongwick | Date: | Wed, 04 Mar 2026 04:51:57 +0000 |
| Subject: | [php-src] Issue #21336: undefined behavior in snmp | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251749@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/21336
Author: chongwick
### Description
The following code:
```php
<?php
$v_4373 = False;
$v_4374 = snmp_set_quick_print($v_4373,);
$v_4375 = SNMP_VALUE_PLAIN;
$v_4376 = snmp_set_valueretrieval($v_4375,);
$v_4378 = $hostname;
$v_4379 = $user_noauth;
$v_4380 = $timeout;
$v_4381 = $retries;
$v_4377 = SNMP::VERSION_3;
$v_4382 = new SNMP($v_4377,$v_4378,$v_4374,$v_4380,$v_4381,);
$v_4422 = 'authPriv';
$v_4384 = $v_4382->setSecurity($v_4422,);
```
Resulted in this output:
```
/home/w023dtc/nightly_php/php-src/ext/snmp/snmp.c:1011:6: runtime error: member access within null
pointer of type 'zend_string' (aka 'struct _zend_string')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
/home/w023dtc/nightly_php/php-src/ext/snmp/snmp.c:1011:6
```
### PHP Version
```plain
nightly
```
### Operating System
_No response_