dovecot: DEBUG: Use t_buffer_alloc_last_full() before calling i_...

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 3 07:20:46 EET 2008


details:   http://hg.dovecot.org/dovecot/rev/1defcf913178
changeset: 7322:1defcf913178
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 03 07:20:41 2008 +0200
description:
DEBUG: Use t_buffer_alloc_last_full() before calling i_warning() to make
sure we don't trash unallocated data from data stack.

diffstat:

1 file changed, 4 insertions(+)
src/lib/mempool-alloconly.c |    4 ++++

diffs (14 lines):

diff -r 26d7e3336a48 -r 1defcf913178 src/lib/mempool-alloconly.c
--- a/src/lib/mempool-alloconly.c	Mon Mar 03 07:19:31 2008 +0200
+++ b/src/lib/mempool-alloconly.c	Mon Mar 03 07:20:41 2008 +0200
@@ -210,6 +210,10 @@ static void block_alloc(struct alloconly
 		size = nearest_power(size);
 #ifdef DEBUG
 		if (!apool->disable_warning) {
+			/* i_warning() overwrites unallocated data in data
+			   stack, so make sure everything is allocated before
+			   calling it. */
+			t_buffer_alloc_last_full();
 			i_warning("Growing pool '%s' with: %"PRIuSIZE_T,
 				  apool->name, size);
 		}


More information about the dovecot-cvs mailing list