]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH 1/2] dsync: Avoid potentially excessive data stack growth for mailbox attribut...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 24 Mar 2026 10:02:00 +0000 (12:02 +0200)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
The attribute value can be large.

Gbp-Pq: Name 0001-dsync-Avoid-potentially-excessive-data-stack-growth-.patch

src/doveadm/dsync/dsync-ibc-stream.c

index 472d1fc5171110bbda6e50debd326d8921ade7f3..0b3038201d6c87be38f6a82509677e816e4e5037 100644 (file)
@@ -1492,12 +1492,12 @@ dsync_ibc_stream_send_mailbox_attribute(struct dsync_ibc *_ibc,
 {
        struct dsync_ibc_stream *ibc = (struct dsync_ibc_stream *)_ibc;
        struct dsync_serializer_encoder *encoder;
-       string_t *str = t_str_new(128);
        char type[2];
 
        if (ibc->minor_version < DSYNC_PROTOCOL_MINOR_HAVE_ATTRIBUTES)
                return;
 
+       string_t *str = str_new(default_pool, 128);
        str_append_c(str, items[ITEM_MAILBOX_ATTRIBUTE].chr);
        encoder = dsync_ibc_send_encode_begin(ibc, ITEM_MAILBOX_ATTRIBUTE);
 
@@ -1538,6 +1538,7 @@ dsync_ibc_stream_send_mailbox_attribute(struct dsync_ibc *_ibc,
                i_stream_ref(ibc->value_output);
                (void)dsync_ibc_stream_send_value_stream(ibc);
        }
+       str_free(&str);
 }
 
 static enum dsync_ibc_recv_ret