提交 e3008464 编写于 作者: S Sean 提交者: Junio C Hamano

Avoid segfault in diff --stat rename output.

Signed-off-by: NSean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 884e3134
......@@ -237,7 +237,7 @@ static char *pprint_rename(const char *a, const char *b)
if (a_midlen < 0) a_midlen = 0;
if (b_midlen < 0) b_midlen = 0;
name = xmalloc(len_a + len_b - pfx_length - sfx_length + 7);
name = xmalloc(pfx_length + a_midlen + b_midlen + sfx_length + 7);
sprintf(name, "%.*s{%.*s => %.*s}%s",
pfx_length, a,
a_midlen, a + pfx_length,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册