From: Timo Sirainen Date: Tue, 28 Jan 2025 13:39:48 +0000 (+0200) Subject: config: Fix error handling for illegal filter ordering X-Git-Tag: 2.4.1~248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bda5145e176adc4c71a1c4d0828de55dabe9b643;p=thirdparty%2Fdovecot%2Fcore.git config: Fix error handling for illegal filter ordering --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index b644efeb8a..cfeede53db 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -1296,7 +1296,7 @@ config_filter_add_new_filter(struct config_parser_context *ctx, ctx->error = p_strdup_printf(ctx->pool, "%s { } must not have a section name", key); - return TRUE; + return FALSE; } filter.filter_name = p_strdup(ctx->pool, key); } else { @@ -1328,7 +1328,7 @@ config_filter_add_new_filter(struct config_parser_context *ctx, if (value[0] == '\0' && !value_quoted) { ctx->error = p_strdup_printf(ctx->pool, "%s { } is missing section name", key); - return TRUE; + return FALSE; } filter.filter_name = p_strdup_printf(ctx->pool, "%s/%s", key, value); @@ -2694,8 +2694,9 @@ void config_parser_apply_line(struct config_parser_context *ctx, ctx->cur_section->key = p_strdup(ctx->pool, key); if (config_filter_add_new_filter(ctx, key, line->value, - line->value_quoted)) { - /* new filter */ + line->value_quoted) || + ctx->error != NULL) { + /* new filter or error */ break; } if (hash_table_lookup(ctx->all_keys, key) == NULL) {