Skip to content

Commit 222083a

Browse files
Ilari Liusvaaragitster
authored andcommitted
Fix integer overflow in patch_delta()
Signed-off-by: Ilari Liusvaara <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5bf9219 commit 222083a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

patch-delta.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ void *patch_delta(const void *src_buf, unsigned long src_size,
3333

3434
/* now the result size */
3535
size = get_delta_hdr_size(&data, top);
36-
dst_buf = xmalloc(size + 1);
37-
dst_buf[size] = 0;
36+
dst_buf = xmallocz(size);
3837

3938
out = dst_buf;
4039
while (data < top) {

0 commit comments

Comments
 (0)