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

snmp SEGV #17330

Closed
YuanchengJiang opened this issue Jan 3, 2025 · 1 comment · May be fixed by #17332
Closed

snmp SEGV #17330

YuanchengJiang opened this issue Jan 3, 2025 · 1 comment · May be fixed by #17332

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
$session = new SNMP(SNMP::VERSION_2c, $hostname, 'timeout_community_432', $timeout, $retries);
$session->close();
$session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass);

Resulted in this output:

/home/phpfuzz/WorkSpace/flowfusion/php-src/ext/snmp/snmp.c:952:6: runtime error: member access within null pointer of type 'struct snmp_session'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/snmp/snmp.c:952:6

PHP Version

nightly

Operating System

No response

@devnexen
Copy link
Member

devnexen commented Jan 3, 2025

I ll have a look later today. Making a fetch object check for accessors seems appropriate.

devnexen added a commit to devnexen/php-src that referenced this issue Jan 3, 2025
…sed.

having new macro when the workflow needs to deal with an existing SNMP session.
devnexen added a commit to devnexen/php-src that referenced this issue Jan 5, 2025
…sed.

checking when the workflow needs to deal with an existing SNMP session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment