Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fix integer overflow in unpack_compressed_entry()
author
Ilari Liusvaara
<ilari.liusvaara@elisanet.fi>
Tue, 26 Jan 2010 18:24:15 +0000
(20:24 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 26 Jan 2010 21:00:16 +0000
(13:00 -0800)
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
3aee68a
)
diff --git
a/sha1_file.c
b/sha1_file.c
index a903247677bfe1d41a14f8f153d66494837c86b7..23d347c45fcf2a93ee59b9ddea996ec432038200 100644
(file)
--- 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;