]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fix potential crash parsing configuration with obsolete settings
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 20 Mar 2024 10:03:43 +0000 (12:03 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 20 Mar 2024 10:03:43 +0000 (12:03 +0200)
src/config/config-parser.c

index 490426b3373a2a109066bb7902baa9fae5d9d470..ccd5e59d61cdbecbccaf49886f967dd8a38e1e37 100644 (file)
@@ -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