提交 1f58a038 编写于 作者: M Michael Haggerty 提交者: Junio C Hamano

resolve_ref(): only follow a symlink that contains a valid, normalized refname

Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 b54cb795
...@@ -521,7 +521,8 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int * ...@@ -521,7 +521,8 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
if (len < 0) if (len < 0)
return NULL; return NULL;
buffer[len] = 0; buffer[len] = 0;
if (!prefixcmp(buffer, "refs/")) { if (!prefixcmp(buffer, "refs/") &&
!check_refname_format(buffer, 0)) {
strcpy(ref_buffer, buffer); strcpy(ref_buffer, buffer);
ref = ref_buffer; ref = ref_buffer;
if (flag) if (flag)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册