summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlari Liusvaara <ilari.liusvaara@elisanet.fi>2010-01-26 18:24:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-26 20:57:59 (GMT)
commit222083a1585c058fd2bbcb76db1ea824ee3df17f (patch)
tree5fd4ec397fb32b91c7ffbd28400b8528be704e0a
parent5bf9219d01b16444b316fe764b58d15bd9265f74 (diff)
downloadgit-222083a1585c058fd2bbcb76db1ea824ee3df17f.zip
git-222083a1585c058fd2bbcb76db1ea824ee3df17f.tar.gz
git-222083a1585c058fd2bbcb76db1ea824ee3df17f.tar.bz2
Fix integer overflow in patch_delta()
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--patch-delta.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/patch-delta.c b/patch-delta.c
index e02e13b..d218faa 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) {