@matheusbsbs / matheus-bagliano / commits / 222083a158
Fork 0

Fix integer overflow in patch_delta()

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ilari Liusvaara committed Jan 26, 2010 at 20:24 UTC 222083a1585c058fd2bbcb76db1ea824ee3df17f
1 file changed +1 -2
patch-delta.c
+1 -2
@@ -33,8 +33,7 @@ void *patch_delta(const void *src_buf, unsigned long src_size,
33
34 /* now the result size */
35 size = get_delta_hdr_size(&data, top);
36 - dst_buf = xmalloc(size + 1);
37 - dst_buf[size] = 0;
36 + dst_buf = xmallocz(size);
37
38 out = dst_buf;
39 while (data < top) {