[Commits] 26920cc: Fix candidate for valgrind error Syscall param pwrite64(buf) points to uninitialised byte(s)

Jan Lindström jan.lindstrom at mariadb.com
Sun Mar 29 11:50:16 EEST 2015


revision-id: 26920cc6a006b4fe74ab0092b2d394199fe51977
parent(s): 86f46a3da4a6d82cb510dc4c270d46cfd6a8965b
committer: Jan Lindström
branch nick: 5.5-git
timestamp: 2015-03-29 11:49:44 +0300
message:

Fix candidate for valgrind error Syscall param pwrite64(buf) points to uninitialised byte(s)

---
 storage/innobase/log/log0log.c | 3 +++
 storage/xtradb/log/log0log.c   | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
index eacee12..4fd9ce4 100644
--- a/storage/innobase/log/log0log.c
+++ b/storage/innobase/log/log0log.c
@@ -1587,6 +1587,9 @@ log_write_up_to(
 		  log_sys->buf + area_end - OS_FILE_LOG_BLOCK_SIZE,
 		  OS_FILE_LOG_BLOCK_SIZE);
 
+	/* Clean up the tail of the log buffer */
+	memset(log_sys->buf+end_offset, 0, (log_sys->buf+area_end)-(log_sys->buf+end_offset));
+
 	log_sys->buf_free += OS_FILE_LOG_BLOCK_SIZE;
 	log_sys->write_end_offset = log_sys->buf_free;
 
diff --git a/storage/xtradb/log/log0log.c b/storage/xtradb/log/log0log.c
index bc208f4..9606749 100644
--- a/storage/xtradb/log/log0log.c
+++ b/storage/xtradb/log/log0log.c
@@ -1694,6 +1694,9 @@ log_write_up_to(
 		  log_sys->buf + area_end - OS_FILE_LOG_BLOCK_SIZE,
 		  OS_FILE_LOG_BLOCK_SIZE);
 
+	/* Clean up the tail of the log buffer */
+	memset(log_sys->buf+end_offset, 0, (log_sys->buf+area_end)-(log_sys->buf+end_offset));
+
 	log_sys->buf_free += OS_FILE_LOG_BLOCK_SIZE;
 	log_sys->write_end_offset = log_sys->buf_free;
 


More information about the commits mailing list