Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH] rerere: fix too-short initialization

From: Jeff King <hidden>
Date: 2016-06-15 22:48:07
Subsystem: the rest · Maintainer: Linus Torvalds

This was caused by a typo in the sizeof parameter, and meant
we looked at uninitialized memory.  Caught by valgrind in
t2030.

Signed-off-by: Jeff King <redacted>
---
I'm running the whole test suite under valgrind for the current
'master'. This was the first hit, but it's very s-l-o-w, so there might
be more as the day progresses.

 rerere.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rerere.c b/rerere.c
index a86d73d..d1d3e75 100644
--- a/rerere.c
+++ b/rerere.c
@@ -325,7 +325,7 @@ static int handle_cache(const char *path, unsigned char *sha1, const char *outpu
 	for (i = 0; i < 3; i++)
 		free(mmfile[i].ptr);
 
-	memset(&io, 0, sizeof(&io));
+	memset(&io, 0, sizeof(io));
 	io.io.getline = rerere_mem_getline;
 	if (output)
 		io.io.output = fopen(output, "w");
-- 
1.7.0.rc0.41.g538720
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help