dovecot-1.1: DEBUG: Buffer overflow checking caused false errors...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 21 21:32:40 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/bbae5b6b6d2b
changeset: 7282:bbae5b6b6d2b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 21 21:34:07 2008 +0200
description:
DEBUG: Buffer overflow checking caused false errors sometimes.

diffstat:

1 file changed, 2 insertions(+), 1 deletion(-)
src/lib/data-stack.c |    3 ++-

diffs (13 lines):

diff -r e5b840b3c5c2 -r bbae5b6b6d2b src/lib/data-stack.c
--- a/src/lib/data-stack.c	Thu Feb 21 19:58:56 2008 +0200
+++ b/src/lib/data-stack.c	Thu Feb 21 21:34:07 2008 +0200
@@ -355,7 +355,8 @@ static void *t_malloc_real(size_t size, 
 	ret = PTR_OFFSET(ret, MEM_ALIGN(sizeof(size)));
 	/* make sure the sentry contains CLEAR_CHRs. it might not if we
 	   had used t_buffer_get(). */
-	memset(PTR_OFFSET(ret, size), CLEAR_CHR, SENTRY_COUNT);
+	memset(PTR_OFFSET(ret, size), CLEAR_CHR,
+	       MEM_ALIGN(size + SENTRY_COUNT) - size);
 #endif
         return ret;
 }


More information about the dovecot-cvs mailing list