]> git.ipfire.org Git - thirdparty/git.git/blobdiff - patch-delta.c
Use symbolic name SHORT_NAME_AMBIGUOUS as error return value
[thirdparty/git.git] / patch-delta.c
index 26281ea1230f730931442bc0ed59966a6f4031be..98c27beb252420102de78e50994ed5cc5b6f564a 100644 (file)
@@ -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) {