summaryrefslogtreecommitdiff
path: root/patch-delta.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-27 14:56:38 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-27 14:56:38 -0800
commita0075d9e6ae211e8bde3eb40c8cdebb1772ee680 (patch)
treeb29228a2bb894edd907b319b23c77025b5f9e407 /patch-delta.c
parentf1694b62bb3a3e1766b92d64a38f61524cc730a0 (diff)
parent4ab07e4d1076a1b94b91d58913daeb20eb1c0e2d (diff)
downloadgit-a0075d9e6ae211e8bde3eb40c8cdebb1772ee680.tar.gz
Merge branch 'il/maint-xmallocz'
* il/maint-xmallocz: Fix integer overflow in unpack_compressed_entry() Fix integer overflow in unpack_sha1_rest() Fix integer overflow in patch_delta() Add xmallocz()
Diffstat (limited to 'patch-delta.c')
-rw-r--r--patch-delta.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/patch-delta.c b/patch-delta.c
index e02e13bd4e..d218faa02b 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) {