projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c2336d
)
libcollectdclient: Ensure vl->values_len is non-zero.
author
Florian Forster
<octo@collectd.org>
Wed, 15 Nov 2017 21:26:11 +0000
(22:26 +0100)
committer
Florian Forster
<octo@collectd.org>
Fri, 17 Nov 2017 12:23:40 +0000
(13:23 +0100)
That size_t is then used to declare Variable Length Arrays. Hopefully
this helps to convince Coverity that pkg_values and pkg_values_types are
actually fully initialized.
CID: 141009, 141010
src/libcollectdclient/network_buffer.c
patch
|
blob
|
history
diff --git
a/src/libcollectdclient/network_buffer.c
b/src/libcollectdclient/network_buffer.c
index
662265d
..
a0f8cfd
100644
(file)
--- a/
src/libcollectdclient/network_buffer.c
+++ b/
src/libcollectdclient/network_buffer.c
@@
-255,6
+255,10
@@
static double htond(double val) /* {{{ */
static int nb_add_values(char **ret_buffer, /* {{{ */
size_t *ret_buffer_len, const lcc_value_list_t *vl) {
+ if ((vl == NULL) || (vl->values_len < 1)) {
+ return EINVAL;
+ }
+
char *packet_ptr;
size_t packet_len;