dovecot-2.2: lib: Fixed __builtin_object_size() usage in buffer.h

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 24 12:21:13 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/81db26c26d6d
changeset: 19208:81db26c26d6d
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 24 15:19:53 2015 +0300
description:
lib: Fixed __builtin_object_size() usage in buffer.h
With type=3 size for unknown objects is set to 0, which causes a compiler
failure. With type=1 it's (size_t)-1, which passes the check.

diffstat:

 src/lib/buffer.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r 0ae88b2978e0 -r 81db26c26d6d src/lib/buffer.h
--- a/src/lib/buffer.h	Thu Sep 24 12:32:24 2015 +0300
+++ b/src/lib/buffer.h	Thu Sep 24 15:19:53 2015 +0300
@@ -20,10 +20,10 @@
 				   const void *data, size_t size);
 #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) > 401
 #define buffer_create_from_data(b,d,s) ({					\
-	(void)COMPILE_ERROR_IF_TRUE(__builtin_object_size((d),3) < ((s)?(s):1)); \
+	(void)COMPILE_ERROR_IF_TRUE(__builtin_object_size((d),1) < ((s)?(s):1)); \
 	buffer_create_from_data((b), (d), (s)); })
 #define buffer_create_from_const_data(b,d,s) ({					\
-	(void)COMPILE_ERROR_IF_TRUE(__builtin_object_size((d),3) < ((s)?(s):1)); \
+	(void)COMPILE_ERROR_IF_TRUE(__builtin_object_size((d),1) < ((s)?(s):1)); \
 	buffer_create_from_const_data((b), (d), (s)); })
 #endif
 /* Creates a dynamically growing buffer. Whenever write would exceed the


More information about the dovecot-cvs mailing list