Mercurial > dovecot > core-2.2
changeset 19208:81db26c26d6d
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.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 24 Sep 2015 15:19:53 +0300 |
parents | 0ae88b2978e0 |
children | a706bdec0200 |
files | src/lib/buffer.h |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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