summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index 473f7f6bc6..b055501899 100644
--- a/refs.c
+++ b/refs.c
@@ -581,6 +581,11 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
buf = buffer + 4;
while (isspace(*buf))
buf++;
+ if (check_refname_format(buf, REFNAME_ALLOW_ONELEVEL)) {
+ warning("symbolic reference in %s is formatted incorrectly",
+ path);
+ return NULL;
+ }
ref = strcpy(ref_buffer, buf);
if (flag)
*flag |= REF_ISSYMREF;