diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2011-09-15 23:10:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-05 13:45:30 -0700 |
commit | 1f58a0383857e5328e3e4d248d6c4a3485098679 (patch) | |
tree | c9d82d75c1569fa7baea45f0b12b768e92dcc747 /refs.c | |
parent | b54cb795970628714a3a9fa0f4a73cd117b0207f (diff) | |
download | git-1f58a0383857e5328e3e4d248d6c4a3485098679.tar.gz |
resolve_ref(): only follow a symlink that contains a valid, normalized refname
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |