projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dffb71c
)
snmp plugin: Issue an error if an instance name is empty.
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
07465dd
..
2026e8b
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-863,6
+863,14
@@
static int csnmp_instance_list_add (csnmp_list_instances_t **head,
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),