From: Michael Haggerty Date: Thu, 15 Sep 2011 21:10:33 +0000 (+0200) Subject: resolve_ref(): only follow a symlink that contains a valid, normalized refname X-Git-Tag: v1.7.8-rc0~19^2~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1f58a0383857e5328e3e4d248d6c4a3485098679;p=git.git resolve_ref(): only follow a symlink that contains a valid, normalized refname Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index da9737f99..8f0b87184 100644 --- a/refs.c +++ b/refs.c @@ -521,7 +521,8 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int * if (len < 0) return NULL; buffer[len] = 0; - if (!prefixcmp(buffer, "refs/")) { + if (!prefixcmp(buffer, "refs/") && + !check_refname_format(buffer, 0)) { strcpy(ref_buffer, buffer); ref = ref_buffer; if (flag)