Skip to content

Commit

Permalink
Fix integer overflow in patch_delta()
Browse files Browse the repository at this point in the history
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ilari Liusvaara authored and Junio C Hamano committed Jan 26, 2010
1 parent 5bf9219 commit 222083a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions patch-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ void *patch_delta(const void *src_buf, unsigned long src_size,

/* now the result size */
size = get_delta_hdr_size(&data, top);
dst_buf = xmalloc(size + 1);
dst_buf[size] = 0;
dst_buf = xmallocz(size);

out = dst_buf;
while (data < top) {
Expand Down

0 comments on commit 222083a

Please sign in to comment.