changeset 7282:bbae5b6b6d2b HEAD

DEBUG: Buffer overflow checking caused false errors sometimes.
author Timo Sirainen <tss@iki.fi>
date Thu, 21 Feb 2008 21:34:07 +0200
parents e5b840b3c5c2
children f70c4d501251
files src/lib/data-stack.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 	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;
 }