summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 22d5f76)
raw | patch | inline | side by side (parent: 22d5f76)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 28 Feb 2015 19:05:14 +0000 (20:05 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 28 Feb 2015 19:05:14 +0000 (20:05 +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 ece9f75f5bbfa781a6f27979eaf0636982205c66..03a49b5643af23a6e2ebc2ccc954586ea1ffff6f 100644 (file)
--- a/src/powerdns.c
+++ b/src/powerdns.c
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;",
return;
}
+ if (lookup_table[i].type == NULL)
+ return;
+
type = lookup_table[i].type;
type_instance = lookup_table[i].type_instance;