Fix integer overflow in patch_delta()
Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5bf9219d01
commit
222083a158
@ -33,8 +33,7 @@ void *patch_delta(const void *src_buf, unsigned long src_size,
|
|||||||
|
|
||||||
/* now the result size */
|
/* now the result size */
|
||||||
size = get_delta_hdr_size(&data, top);
|
size = get_delta_hdr_size(&data, top);
|
||||||
dst_buf = xmalloc(size + 1);
|
dst_buf = xmallocz(size);
|
||||||
dst_buf[size] = 0;
|
|
||||||
|
|
||||||
out = dst_buf;
|
out = dst_buf;
|
||||||
while (data < top) {
|
while (data < top) {
|
||||||
|
Loading…
Reference in New Issue
Block a user