From: Ruben Kerkhof Date: Sat, 28 Feb 2015 19:05:14 +0000 (+0100) Subject: Powerdns plugin: fix logging on failed lookup X-Git-Tag: collectd-5.5.0~74^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F953%2Fhead;p=thirdparty%2Fcollectd.git Powerdns plugin: fix logging on failed lookup Don't look past the end of the array but check the boundary first. --- diff --git a/src/powerdns.c b/src/powerdns.c index ece9f75f5..03a49b564 100644 --- 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;