Bug #79569 [NEW]: State leak between SNMP::walk(oid, false) calls

From: Date: Tue, 05 May 2020 22:25:02 +0000
Subject: Bug #79569 [NEW]: State leak between SNMP::walk(oid, false) calls
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226933@lists.php.net to get a copy of this message
From: grzegorz129 at gmail dot com Operating system: N/A PHP version: 7.4.5 Package: SNMP related Bug Type: Bug Bug description:State leak between SNMP::walk(oid, false) calls Description: ------------ When SNMP::walk() is called with a numeric OID it provides generic results any number of times. However, as soon as it's called with the textual OID corresponding to the numeric one any subsequent calls with that numerical OID will suddenly start returning results in a different format (exactly like with the textual one). It's pretty hard to describe, however looking at the "Actual result" section clearly shows the problem. Test script: --------------- /* No simple script available due to external server being required. - \SNMP was configured with v3 protocol including auth & priv - oid_output_format = \SNMP_OID_OUTPUT_SUFFIX - exceptions_enabled = \SNMP::ERRNO_ANY - quick_print = true #1 ‌‌->walk('.1.3.6.1.4.1.6574.2.1.1', false); #2 ->walk('.1.3.6.1.4.1.6574.2.1.1', false); => result exactly like in #1 #3 ->walk('SYNOLOGY-DISK-MIB::diskTable', false); => result with names #4 ->walk('.1.3.6.1.4.1.6574.2.1.1', false); => result like in #3 instead of #1-#2 */ Actual result: -------------- ‌‌$snmp->walk('.1.3.6.1.4.1.6574.2.1.1', false); ‌array ( 'synology.2.1.1.2.0' => '"Drive 1"', 'synology.2.1.1.2.1' => '"Drive 2"', 'synology.2.1.1.2.2' => '"Drive 3"', 'synology.2.1.1.2.3' => '"Drive 4"', 'synology.2.1.1.2.4' => '"Drive 5"', 'synology.2.1.1.3.0' => '"WD40EFRX-68WT0N0 "', 'synology.2.1.1.3.1' => '"WD40EFRX-68N32N0 "', 'synology.2.1.1.3.2' => '"ST6000VN0033-2EE110 "', 'synology.2.1.1.3.3' => '"WD60EFRX-68L0BN1 "', 'synology.2.1.1.3.4' => '"ST1000LM010-9YH146 "', 'synology.2.1.1.4.0' => '"SATA"', 'synology.2.1.1.4.1' => '"SATA"', 'synology.2.1.1.4.2' => '"SATA"', 'synology.2.1.1.4.3' => '"SATA"', 'synology.2.1.1.4.4' => '"SATA"', 'synology.2.1.1.5.0' => '1', 'synology.2.1.1.5.1' => '1', 'synology.2.1.1.5.2' => '1', 'synology.2.1.1.5.3' => '1', 'synology.2.1.1.5.4' => '1', 'synology.2.1.1.6.0' => '37', 'synology.2.1.1.6.1' => '34', 'synology.2.1.1.6.2' => '39', 'synology.2.1.1.6.3' => '37', 'synology.2.1.1.6.4' => '31', ) ‌‌$snmp->walk('SYNOLOGY-DISK-MIB::diskTable', false); ‌array ( 'diskID.0' => '"Drive 1"', 'diskID.1' => '"Drive 2"', 'diskID.2' => '"Drive 3"', 'diskID.3' => '"Drive 4"', 'diskID.4' => '"Drive 5"', 'diskModel.0' => '"WD40EFRX-68WT0N0 "', 'diskModel.1' => '"WD40EFRX-68N32N0 "', 'diskModel.2' => '"ST6000VN0033-2EE110 "', 'diskModel.3' => '"WD60EFRX-68L0BN1 "', 'diskModel.4' => '"ST1000LM010-9YH146 "', 'diskType.0' => '"SATA"', 'diskType.1' => '"SATA"', 'diskType.2' => '"SATA"', 'diskType.3' => '"SATA"', 'diskType.4' => '"SATA"', 'diskStatus.0' => '1', 'diskStatus.1' => '1', 'diskStatus.2' => '1', 'diskStatus.3' => '1', 'diskStatus.4' => '1', 'diskTemperature.0' => '37', 'diskTemperature.1' => '34', 'diskTemperature.2' => '39', 'diskTemperature.3' => '37', 'diskTemperature.4' => '31', ) ‌‌$snmp->walk('.1.3.6.1.4.1.6574.2.1.1', false); ‌array ( 'diskID.0' => '"Drive 1"', 'diskID.1' => '"Drive 2"', 'diskID.2' => '"Drive 3"', 'diskID.3' => '"Drive 4"', 'diskID.4' => '"Drive 5"', 'diskModel.0' => '"WD40EFRX-68WT0N0 "', 'diskModel.1' => '"WD40EFRX-68N32N0 "', 'diskModel.2' => '"ST6000VN0033-2EE110 "', 'diskModel.3' => '"WD60EFRX-68L0BN1 "', 'diskModel.4' => '"ST1000LM010-9YH146 "', 'diskType.0' => '"SATA"', 'diskType.1' => '"SATA"', 'diskType.2' => '"SATA"', 'diskType.3' => '"SATA"', 'diskType.4' => '"SATA"', 'diskStatus.0' => '1', 'diskStatus.1' => '1', 'diskStatus.2' => '1', 'diskStatus.3' => '1', 'diskStatus.4' => '1', 'diskTemperature.0' => '37', 'diskTemperature.1' => '34', 'diskTemperature.2' => '39', 'diskTemperature.3' => '37', 'diskTemperature.4' => '31', ) -- Edit bug report at https://bugs.php.net/bug.php?id=79569&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79569&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79569&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79569&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79569&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79569&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79569&r=support Expected behavior: https://bugs.php.net/fix.php?id=79569&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79569&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79569&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79569&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79569&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79569&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79569&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79569&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79569&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79569&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79569&r=mysqlcfg

« previous php.bugs (#226933) next »