From: Ilari Liusvaara Date: Tue, 26 Jan 2010 18:24:13 +0000 (+0200) Subject: Fix integer overflow in patch_delta() X-Git-Tag: v1.7.0-rc1~25^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=222083a1585c058fd2bbcb76db1ea824ee3df17f;p=git.git Fix integer overflow in patch_delta() Signed-off-by: Ilari Liusvaara Signed-off-by: Junio C Hamano --- diff --git a/patch-delta.c b/patch-delta.c index e02e13bd4..d218faa02 100644 --- a/patch-delta.c +++ b/patch-delta.c @@ -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) {