From 46d07e4ea1b82606f3fc29024dc9f8eb5c05fa4d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 22 Jul 2016 17:56:50 +0200 Subject: fix bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libcoopgamma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcoopgamma.c b/src/libcoopgamma.c index 235864a..924e936 100644 --- a/src/libcoopgamma.c +++ b/src/libcoopgamma.c @@ -1611,7 +1611,7 @@ int libcoopgamma_synchronise(libcoopgamma_context_t* restrict ctx, ssize_t n__; \ char* msg__; \ snprintf(NULL, (size_t)0, format "%zn", __VA_ARGS__, &n__); \ - msg__ = malloc((size_t)n__ + (payload_size)); \ + msg__ = malloc((size_t)n__ + (payload_size) + (size_t)1); \ if (msg__ == NULL) \ goto fail; \ sprintf(msg__, format, __VA_ARGS__); \ -- cgit v1.2.3-70-g09d2