summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dffb71c)
raw | patch | inline | side by side (parent: dffb71c)
author | Florian Forster <octo@noris.net> | |
Tue, 12 Aug 2008 09:30:07 +0000 (11:30 +0200) | ||
committer | Florian Forster <octo@noris.net> | |
Tue, 12 Aug 2008 09:30:07 +0000 (11:30 +0200) |
src/snmp.c | patch | blob | history |
diff --git a/src/snmp.c b/src/snmp.c
index 07465ddd26d1a951addd40b0ea28f9a7cad6b409..2026e8bc4151c5ebbb86ec48d2f24c4a8a25fd1e 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
if (instance_len > vb->val_len)
instance_len = vb->val_len;
+ if (instance_len < 1)
+ {
+ ERROR ("snmp plugin: csnmp_instance_list_add: instance_len = %zu, "
+ "which is less than one.", instance_len);
+ sfree (il);
+ return (-1);
+ }
+
sstrncpy (il->instance, (char *) ((vb->type == ASN_OCTET_STR)
? vb->val.string
: vb->val.bitstring),