summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2011-09-15 23:10:39 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-05 13:45:31 -0700
commit8384d78886eca05cae2a4c1bccaee379d76c1e06 (patch)
treeef6710f2ad28d3b23c94c43d1d5fbdc1210362a0
parentd51b720fca4ee5418952a90f785317592a7a1242 (diff)
downloadgit-8384d78886eca05cae2a4c1bccaee379d76c1e06.tar.gz
resolve_ref(): verify that the input refname has the right format
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--refs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index b055501899..ee3e0cc560 100644
--- a/refs.c
+++ b/refs.c
@@ -504,6 +504,9 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
if (flag)
*flag = 0;
+ if (check_refname_format(ref, REFNAME_ALLOW_ONELEVEL))
+ return NULL;
+
for (;;) {
char path[PATH_MAX];
struct stat st;