From aea0b6180f03f747b7195188559f32300ebda2f9 Mon Sep 17 00:00:00 2001 From: Joseph Tingiris Date: Sun, 16 Feb 2020 20:33:39 -0500 Subject: [PATCH] Invalidate 'Wrong Type' snmp_walk() data (#11159) * Invalidate 'Wrong Type' snmp_walk() data * remove blank line, space before $data --- includes/snmp.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index d777a2f416..348728d953 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -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)')) {