[libvirt] [PATCH] Fix logging buffer overrun read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* src/logging.c: Fix buffer offset in logging read
---
 src/logging.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/logging.c b/src/logging.c
index e46e2be..07c2b0e 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);
-- 
1.6.2.5

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]