projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f8f2f9
)
Powerdns plugin: fix logging on failed lookup
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Sat, 28 Feb 2015 19:05:14 +0000
(20:05 +0100)
committer
Marc Fournier
<marc.fournier@camptocamp.com>
Tue, 3 Mar 2015 22:56:39 +0000
(23:56 +0100)
Don't look past the end of the array but check the boundary first.
src/powerdns.c
patch
|
blob
|
history
diff --git
a/src/powerdns.c
b/src/powerdns.c
index
a140a12
..
f3d4083
100644
(file)
--- a/
src/powerdns.c
+++ b/
src/powerdns.c
@@
-259,9
+259,6
@@
static void submit (const char *plugin_instance, /* {{{ */
if (strcmp (lookup_table[i].name, pdns_type) == 0)
break;
- if (lookup_table[i].type == NULL)
- return;
-
if (i >= lookup_table_length)
{
INFO ("powerdns plugin: submit: Not found in lookup table: %s = %s;",
@@
-269,6
+266,9
@@
static void submit (const char *plugin_instance, /* {{{ */
return;
}
+ if (lookup_table[i].type == NULL)
+ return;
+
type = lookup_table[i].type;
type_instance = lookup_table[i].type_instance;