projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
plugin.c: fix potential null pointer dereference
[collectd.git]
/
src
/
daemon
/
plugin.c
diff --git
a/src/daemon/plugin.c
b/src/daemon/plugin.c
index
e593939
..
fa78fa0
100644
(file)
--- a/
src/daemon/plugin.c
+++ b/
src/daemon/plugin.c
@@
-2088,8
+2088,10
@@
static int plugin_dispatch_values_internal (value_list_t *vl)
int free_meta_data = 0;
int free_meta_data = 0;
- if ((vl == NULL) || (vl->type[0] == 0)
- || (vl->values == NULL) || (vl->values_len < 1))
+ assert(vl);
+ assert(vl->plugin);
+
+ if (vl->type[0] == 0 || vl->values == NULL || vl->values_len < 1)
{
ERROR ("plugin_dispatch_values: Invalid value list "
"from plugin %s.", vl->plugin);
{
ERROR ("plugin_dispatch_values: Invalid value list "
"from plugin %s.", vl->plugin);
@@
-2354,7
+2356,7
@@
int plugin_dispatch_multivalue (value_list_t const *template, /* {{{ */
assert (template->values_len == 1);
assert (template->values_len == 1);
- /* Calculate sum for Gauge to calculate percent if needed */
+
/* Calculate sum for Gauge to calculate percent if needed */
if (DS_TYPE_GAUGE == store_type) {
va_start (ap, store_type);
while (42)
if (DS_TYPE_GAUGE == store_type) {
va_start (ap, store_type);
while (42)