parse_ref_line(): add a check that the refname is properly formatted

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty
2011-10-19 23:44:43 +02:00
committed by Junio C Hamano
parent 117e8b6037
commit 011e9393ed

3
refs.c
View File

@@ -51,6 +51,9 @@ static const char *parse_ref_line(char *line, unsigned char *sha1)
return NULL;
line[len] = 0;
if (check_refname_format(line, REFNAME_ALLOW_ONELEVEL))
return NULL;
return line;
}