Browse Source

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>
maint
Ilari Liusvaara 15 years ago committed by Junio C Hamano
parent
commit
4ab07e4d10
  1. 3
      sha1_file.c

3
sha1_file.c

@ -1582,8 +1582,7 @@ static void *unpack_compressed_entry(struct packed_git *p, @@ -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;

Loading…
Cancel
Save