From: Timo Sirainen Date: Thu, 24 Sep 2015 12:19:53 +0000 (+0300) Subject: lib: Fixed __builtin_object_size() usage in buffer.h X-Git-Tag: 2.2.19.rc2~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f67a12c7a2dd33b69b303a7cab85c7ed82ba4d85;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/lib/buffer.h b/src/lib/buffer.h index 54dcaa4589..f924a93045 100644 --- a/src/lib/buffer.h +++ b/src/lib/buffer.h @@ -20,10 +20,10 @@ void buffer_create_from_const_data(buffer_t *buffer, 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