From bf0bcee9ec51959976bfb1dfdbfd2aa63c8f82c9 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 7 Nov 2012 12:38:31 +0100 Subject: [PATCH] Fixed output of longer debug messages (v)snprintf(3) returns the length without terminating null byte but the length given as parameter must include it. --- src/libcharon/bus/bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcharon/bus/bus.c b/src/libcharon/bus/bus.c index 1f9592e6e..144a06908 100644 --- a/src/libcharon/bus/bus.c +++ b/src/libcharon/bus/bus.c @@ -309,6 +309,7 @@ METHOD(bus_t, vlog, void, va_end(copy); if (len >= sizeof(buf)) { + len++; data.message = malloc(len); len = vsnprintf(data.message, len, format, args); }