From c51de06b0d3380a85de411a4b346ae4eaf1541d5 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 6 Aug 2018 11:36:41 +0300 Subject: [PATCH] doveconf: Fix compiler nit Ensure secret_r cannot be NULL unless none was found. --- src/config/doveconf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config/doveconf.c b/src/config/doveconf.c index 709a53188f..bf1670a103 100644 --- a/src/config/doveconf.c +++ b/src/config/doveconf.c @@ -183,6 +183,7 @@ static const char *find_next_secret(const char *input, const char **secret_r) { const char *const *secret; const char *ptr = NULL; + *secret_r = NULL; for(secret = secrets; *secret != NULL; secret++) { const char *cptr; if ((cptr = strstr(input, *secret)) != NULL) { @@ -192,6 +193,7 @@ static const char *find_next_secret(const char *input, const char **secret_r) } } } + i_assert(*secret_r != NULL || ptr == NULL); return ptr; } -- 2.47.3