git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rerere: fix too-short initialization
@ 2010-01-28 14:52 Jeff King
  2010-01-29 10:25 ` [PATCH 0/3] valgrind bug roundup Jeff King
  0 siblings, 1 reply; 13+ messages in thread
From: Jeff King @ 2010-01-28 14:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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 <peff@peff.net>
---
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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-01-31 21:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 14:52 [PATCH] rerere: fix too-short initialization Jeff King
2010-01-29 10:25 ` [PATCH 0/3] valgrind bug roundup Jeff King
2010-01-29 10:28   ` [PATCH 1/3] fix memcpy of overlapping area Jeff King
2010-01-29 10:31   ` [PATCH 2/3] fix off-by-one allocation error Jeff King
2010-01-29 10:37   ` [PATCH 3/3] add shebang line to git-mergetool--lib.sh Jeff King
2010-01-29 14:50     ` [PATCH] Do not install shell libraries executable Jonathan Nieder
2010-01-31  7:08       ` Junio C Hamano
2010-01-31  8:34         ` [PATCH v2] " Jonathan Nieder
2010-01-31 19:46           ` Junio C Hamano
2010-01-31 20:00             ` Jonathan Nieder
2010-01-31 20:05               ` Junio C Hamano
2010-01-31 21:00                 ` Jonathan Nieder
2010-01-31 21:08                   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).