From: Daniel P. Berrange Date: Thu, 3 Sep 2009 16:36:59 +0000 (+0100) Subject: Fix logging buffer overrun read X-Git-Tag: v0.7.1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=755915ea4b36f5a17473f07e857cb01acdf6adcb;p=thirdparty%2Flibvirt.git Fix logging buffer overrun read * src/logging.c: Fix buffer offset in logging read --- diff --git a/src/logging.c b/src/logging.c index e46e2bebc0..07c2b0e907 100644 --- a/src/logging.c +++ b/src/logging.c @@ -240,7 +240,7 @@ static void virLogStr(const char *str, int len) { tmp = LOG_BUFFER_SIZE - virLogEnd; memcpy(&virLogBuffer[virLogEnd], str, tmp); virLogBuffer[LOG_BUFFER_SIZE] = 0; - memcpy(&virLogBuffer[0], &str[len], len - tmp); + memcpy(&virLogBuffer[0], &str[tmp], len - tmp); virLogEnd = len - tmp; } else { memcpy(&virLogBuffer[virLogEnd], str, len);