summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patch-delta.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/patch-delta.c b/patch-delta.c
index 26281ea123..98c27beb25 100644
--- a/patch-delta.c
+++ b/patch-delta.c
@@ -34,9 +34,10 @@ void *patch_delta(void *src_buf, unsigned long src_size,
/* now the result size */
size = get_delta_hdr_size(&data);
- dst_buf = malloc(size);
+ dst_buf = malloc(size + 1);
if (!dst_buf)
return NULL;
+ dst_buf[size] = 0;
out = dst_buf;
while (data < top) {