提交 755915ea 编写于 作者: D Daniel P. Berrange

Fix logging buffer overrun read

* src/logging.c: Fix buffer offset in logging read
上级 5c8d3d3b
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册