From dacaea330de26ca07de32f6b9cf8eecde1eb99e2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 6 Oct 2019 23:34:33 +0100 Subject: [PATCH] conffile: find_cl_if: fix fail_if_invalid==False If the key was not found, this would segfault, so passing False didn't work properly. Currently nothing does, so this bug is latent. Signed-off-by: Ian Jackson --- conffile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/conffile.c b/conffile.c index c03c1d8..e6cf48f 100644 --- a/conffile.c +++ b/conffile.c @@ -661,6 +661,7 @@ void *find_cl_if(dict_t *dict, cstring_t name, uint32_t type, closure_t *cl; i = dict_find_item(dict,name,fail_if_invalid,desc,loc); + if (!i) return NULL; if (i->type!=t_closure) { if (!fail_if_invalid) return NULL; cfgfatal(loc,desc,"\"%s\" must be a closure\n",name); -- 2.30.2