提交 4fa1604f 编写于 作者: J Junio C Hamano

Fix refname termination.

When a new ref is being pushed, the name of it was not
terminated properly.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 b32e986c
......@@ -169,7 +169,7 @@ static int match_explicit_refs(struct ref *src, struct ref *dst,
/* pushing "master:master" when
* remote does not have master yet.
*/
int len = strlen(matched_src->name);
int len = strlen(matched_src->name) + 1;
matched_dst = xcalloc(1, sizeof(*dst) + len);
memcpy(matched_dst->name, matched_src->name,
len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册