Skip to content

Commit

Permalink
rerere: fix too-short initialization
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Jan 28, 2010
1 parent 8e52dc3 commit af86deb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rerere.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit af86deb

Please sign in to comment.