diff options
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | 2010-01-26 20:24:13 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-26 12:57:59 -0800 |
commit | 222083a1585c058fd2bbcb76db1ea824ee3df17f (patch) | |
tree | 5fd4ec397fb32b91c7ffbd28400b8528be704e0a /patch-delta.c | |
parent | 5bf9219d01b16444b316fe764b58d15bd9265f74 (diff) | |
download | git-222083a1585c058fd2bbcb76db1ea824ee3df17f.tar.gz |
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.c | 3 |
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) { |