Skip to content
Permalink
Browse files

check if types match in cf_find() when ident1 == CF_IDENT_ANY

That way we can return the thing we want, not some random similar
thing.
  • Loading branch information
alandekok committed Aug 12, 2019
1 parent ff82bd3 commit fd2ee585f300c4c2b5a7d6523de20187e44acec1
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/lib/server/cf_util.c
@@ -124,8 +124,12 @@ static CONF_ITEM *cf_find(CONF_ITEM const *parent, CONF_ITEM_TYPE type, char con
CONF_ITEM *ci;

for (ci = parent->child;
ci && (cf_ident2_cmp(find, ci) != 0);
ci = ci->next);
ci != NULL;
ci = ci->next) {
if (find->type != ci->type) continue;

if (cf_ident2_cmp(find, ci) == 0) break;
}

return ci;
}

0 comments on commit fd2ee58

Please sign in to comment.
You can’t perform that action at this time.