Invalidate 'Wrong Type' snmp_walk() data (#11159)

* Invalidate 'Wrong Type' snmp_walk() data

* remove blank line, space before $data
This commit is contained in:
Joseph Tingiris
2020-02-16 20:33:39 -05:00
committed by GitHub
parent b78084f1ba
commit aea0b6180f

View File

@ -386,7 +386,8 @@ function snmp_walk($device, $oid, $options = null, $mib = null, $mibdir = null)
$data = str_replace('"', '', $data);
$data = str_replace('End of MIB', '', $data);
if (is_string($data) && (preg_match('/No Such (Object|Instance)/i', $data))) {
if (is_string($data) && (preg_match('/No Such (Object|Instance)/i', $data) || preg_match('/Wrong Type(.*)should be/', $data))) {
d_echo("Invalid snmp_walk() data = " . print_r($data, true));
$data = false;
} else {
if (ends_with($data, '(It is past the end of the MIB tree)')) {