projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warnings.
[collectd.git]
/
src
/
snmp.c
diff --git
a/src/snmp.c
b/src/snmp.c
index
3dd08e4
..
4dd1d10
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-1241,6
+1241,7
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
data->type, ds->ds_num, data->values_len);
return (-1);
}
+ assert (data->values_len > 0);
/* We need a copy of all the OIDs, because GETNEXT will destroy them. */
memcpy (oid_list, data->values, data->values_len * sizeof (oid_t));