From: Tobias Brunner Date: Wed, 7 Nov 2012 11:38:31 +0000 (+0100) Subject: Fixed output of longer debug messages X-Git-Tag: 5.0.2dr4~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf0bcee9ec51959976bfb1dfdbfd2aa63c8f82c9;p=thirdparty%2Fstrongswan.git 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. --- diff --git a/src/libcharon/bus/bus.c b/src/libcharon/bus/bus.c index 1f9592e6ec..144a06908e 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); }