From 4e52c1dcb4a8595b5f6e5d9f3df291a488a6fab8 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 28 Feb 2015 20:05:14 +0100 Subject: [PATCH] Powerdns plugin: fix logging on failed lookup Don't look past the end of the array but check the boundary first. --- src/powerdns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/powerdns.c b/src/powerdns.c index ece9f75f..03a49b56 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; -- 2.30.2