summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrb <github.adrb@adrb.pl>2022-07-24 14:44:16 (GMT)
committerGitHub <noreply@github.com>2022-07-24 14:44:16 (GMT)
commit9f2a9ca3d72023ff9b5707d1872c54d65edc9017 (patch)
tree3eae954ad8a0dd523c1ecde325258550b915ba2b
parent65fc7064295ac70d1388fa4db4d4d2cddd531e24 (diff)
downloadmonitoring-plugins-9f2a9ca3d72023ff9b5707d1872c54d65edc9017.tar.gz
check_snmp: Segfault if number of processed lines is greater than number of thresholds
Segfault at line 489 if number of processed lines is greater than number (#1589) of thresholds Co-authored-by: Lorenz <12514511+RincewindsHat@users.noreply.github.com>
-rw-r--r--plugins/check_snmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index bd13e57..2601ccd 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -376,7 +376,7 @@ main (int argc, char **argv)
376 } 376 }
377 } 377 }
378 378
379 for (line=0, i=0; line < chld_out.lines; line++, i++) { 379 for (line=0, i=0; line < chld_out.lines && i < numoids ; line++, i++) {
380 if(calculate_rate) 380 if(calculate_rate)
381 conv = "%.10g"; 381 conv = "%.10g";
382 else 382 else