diff options
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | 2010-01-26 20:24:15 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-26 13:00:16 -0800 |
commit | 4ab07e4d1076a1b94b91d58913daeb20eb1c0e2d (patch) | |
tree | ad39edebdaecdb6160f7659ccea26e8a2201a6b7 /sha1_file.c | |
parent | 3aee68aa68e80856de26340b707148d8f8d5b82e (diff) | |
download | git-4ab07e4d1076a1b94b91d58913daeb20eb1c0e2d.tar.gz |
Fix integer overflow in unpack_compressed_entry()
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c index a903247677..23d347c45f 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1582,8 +1582,7 @@ static void *unpack_compressed_entry(struct packed_git *p, z_stream stream; unsigned char *buffer, *in; - buffer = xmalloc(size + 1); - buffer[size] = 0; + buffer = xmallocz(size); memset(&stream, 0, sizeof(stream)); stream.next_out = buffer; stream.avail_out = size + 1; |