summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2003-02-03 21:43:18 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2003-02-03 21:43:18 (GMT)
commit3c6bec5c63e0bcb57d31ed6c0d1a62105aac299b (patch)
tree4710133fd33ecf4bede3ed8669704b997dd0f1a3
parent1a1403e4b9c5393841e0398e07c5666d3cc4415c (diff)
downloadmonitoring-plugins-3c6bec5c63e0bcb57d31ed6c0d1a62105aac299b.tar.gz
Avoid core dump with null or invalid data (679400 - Mathieu Masseboeuf)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@285 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_snmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 83083a8..a4be11b 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -321,6 +321,8 @@ main (int argc, char **argv)
321 eval_method[i] & WARN_EQ || 321 eval_method[i] & WARN_EQ ||
322 eval_method[i] & WARN_NE) { 322 eval_method[i] & WARN_NE) {
323 p2 = strpbrk (p2, "0123456789"); 323 p2 = strpbrk (p2, "0123456789");
324 if (p2 == NULL)
325 terminate (STATE_UNKNOWN,"No valid data returned");
324 response_value[i] = strtoul (p2, NULL, 10); 326 response_value[i] = strtoul (p2, NULL, 10);
325 iresult = check_num (i); 327 iresult = check_num (i);
326 asprintf (&show, "%lu", response_value[i]); 328 asprintf (&show, "%lu", response_value[i]);