projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff59046
)
powerdns plugin: Ensure powerdns_get_data() returns a non-NULL buffer.
author
Florian Forster
<octo@collectd.org>
Fri, 1 Dec 2017 11:05:21 +0000
(12:05 +0100)
committer
Florian Forster
<octo@collectd.org>
Fri, 1 Dec 2017 13:20:11 +0000
(14:20 +0100)
Coverity is concerned that if buffer is NULL, strtok_r() is called with
two NULL arguments, causing a NULL pointer dereference.
CID: 37968
src/powerdns.c
patch
|
blob
|
history
diff --git
a/src/powerdns.c
b/src/powerdns.c
index
f2149ef
..
fa3eef3
100644
(file)
--- a/
src/powerdns.c
+++ b/
src/powerdns.c
@@
-598,6
+598,9
@@
static int powerdns_read_server(list_item_t *item) /* {{{ */
status = powerdns_get_data(item, &buffer, &buffer_size);
if (status != 0)
return (-1);
+ if ((buffer == NULL) || (buffer_size == 0)) {
+ return EINVAL;
+ }
if (item->fields_num != 0) {
fields = (const char *const *)item->fields;