]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fail config parsing on unknown section names
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 26 Jan 2024 01:29:54 +0000 (03:29 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
src/config/config-parser.c

index 53d4c07cb6ca88c4a628ef1e683ce9f12ce3c243..04dc6d5de8a2da10a1094c4fb3d336de9e0d146b 100644 (file)
@@ -1954,6 +1954,11 @@ void config_parser_apply_line(struct config_parser_context *ctx,
                        /* new filter */
                        break;
                }
+               if (hash_table_lookup(ctx->all_keys, line->key) == NULL) {
+                       ctx->error = p_strdup_printf(ctx->pool,
+                               "Unknown section name: %s", line->key);
+                       break;
+               }
 
                /* This is SET_STRLIST or SET_BOOLLIST */
                break;