diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-02-03 21:43:18 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-02-03 21:43:18 +0000 |
commit | 3c6bec5c63e0bcb57d31ed6c0d1a62105aac299b (patch) | |
tree | 4710133fd33ecf4bede3ed8669704b997dd0f1a3 /plugins/check_snmp.c | |
parent | 1a1403e4b9c5393841e0398e07c5666d3cc4415c (diff) | |
download | monitoring-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
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r-- | plugins/check_snmp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 83083a85..a4be11bc 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -321,6 +321,8 @@ main (int argc, char **argv) eval_method[i] & WARN_EQ || eval_method[i] & WARN_NE) { p2 = strpbrk (p2, "0123456789"); + if (p2 == NULL) + terminate (STATE_UNKNOWN,"No valid data returned"); response_value[i] = strtoul (p2, NULL, 10); iresult = check_num (i); asprintf (&show, "%lu", response_value[i]); |