X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=patch-delta.c;h=98c27beb252420102de78e50994ed5cc5b6f564a;hb=ee34518d629331dadd58b1a75294369d679eda8b;hp=26281ea1230f730931442bc0ed59966a6f4031be;hpb=80bd6f3064a6009cd18a4dab9ce6d29681cec4af;p=git.git diff --git a/patch-delta.c b/patch-delta.c index 26281ea1..98c27beb 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) {