difftool: handle unmerged files in dir-diff mode
[gitweb.git] / builtin / receive-pack.c
index 3dc3868c8694f3a97e69d2f147bef0a0dbd379e3..c8e32b297c4be68bb0d33a6a88c15470821ae4ea 100644 (file)
@@ -1372,7 +1372,7 @@ static struct command **queue_command(struct command **tail,
 
        refname = line + 82;
        reflen = linelen - 82;
-       cmd = xcalloc(1, sizeof(struct command) + reflen + 1);
+       cmd = xcalloc(1, st_add3(sizeof(struct command), reflen, 1));
        hashcpy(cmd->old_sha1, old_sha1);
        hashcpy(cmd->new_sha1, new_sha1);
        memcpy(cmd->ref_name, refname, reflen);