]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fix writing delayed errors for filters
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 18 Sep 2023 10:09:01 +0000 (13:09 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 3 Jun 2024 16:00:28 +0000 (16:00 +0000)
The index number was moved elsewhere, it shouldn't be here.

src/config/config-dump-full.c

index 6eadf0360a71bcbbf286129ba20ef4866171c7b0..4fc17271b0727c515dd0b80560e94acb261bad11 100644 (file)
@@ -285,18 +285,11 @@ config_dump_full_handle_error(struct dump_context *dump_ctx,
                return -1;
        }
 
-       string_t *str = t_str_new(256);
-       if (dump_ctx->filter != NULL) {
-               uint32_t filter_idx_be32 = cpu32_to_be(dump_ctx->filter_idx);
-               o_stream_nsend(output, &filter_idx_be32,
-                              sizeof(filter_idx_be32));
-       }
-       str_append(str, error);
-       str_append_c(str, '\0');
-
-       uint64_t blob_size = cpu64_to_be(str_len(str));
+       size_t error_len = strlen(error) + 1;
+       uint64_t blob_size = cpu64_to_be(error_len);
        o_stream_nsend(output, &blob_size, sizeof(blob_size));
-       o_stream_nsend(output, str_data(str), str_len(str));
+       o_stream_nsend(output, error, error_len);
+       dump_ctx->filter_written = TRUE;
        return 0;
 }