]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: data-stack - t_try_realloc() - Add missing data_stack_last_buffer_reset() call
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 19 Jul 2021 10:54:24 +0000 (13:54 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 19 Jul 2021 11:10:44 +0000 (11:10 +0000)
This fixes incorrect "buffer overflow" panics with DEBUG builds.

src/lib/data-stack.c

index 59d268d91bacf2401206dfd84b234c18f4f09ded..c0c52b6850f358f93a5242840eb220be805246e6 100644 (file)
@@ -541,6 +541,7 @@ t_try_realloc(void *mem, size_t size)
        if (unlikely(size == 0 || size > SSIZE_T_MAX))
                i_panic("Trying to allocate %zu bytes", size);
        block_canary_check(current_block);
+       data_stack_last_buffer_reset(TRUE);
 
        last_alloc_size = current_frame->last_alloc_size;