Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlari Liusvaara <ilari.liusvaara@elisanet.fi>2010-01-26 21:24:13 +0300
committerJunio C Hamano <gitster@pobox.com>2010-01-26 23:57:59 +0300
commit222083a1585c058fd2bbcb76db1ea824ee3df17f (patch)
tree5fd4ec397fb32b91c7ffbd28400b8528be704e0a /patch-delta.c
parent5bf9219d01b16444b316fe764b58d15bd9265f74 (diff)
Fix integer overflow in patch_delta()
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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) {