From: Timo Sirainen Date: Wed, 20 Mar 2024 10:03:43 +0000 (+0200) Subject: config: Fix potential crash parsing configuration with obsolete settings X-Git-Tag: 2.4.0~1710 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b67affb477ba3cedc8f2e101d72bf4491d59c3f;p=thirdparty%2Fdovecot%2Fcore.git config: Fix potential crash parsing configuration with obsolete settings --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 490426b337..ccd5e59d61 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -1335,6 +1335,12 @@ config_parser_check_warnings(struct config_parser_context *ctx, const char *key) { const char *path, *first_pos; + if (ctx->cur_input == NULL) { + /* coming from old_settings_handle_post() - we don't need to + track seen settings in there. */ + return; + } + first_pos = hash_table_lookup(ctx->seen_settings, key); if (ctx->cur_section->prev == NULL) { /* changing a root setting. if we've already seen it inside