From 011e9393ed442ecddc5c16e6776f78e543afb996 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Wed, 19 Oct 2011 23:44:43 +0200 Subject: [PATCH] parse_ref_line(): add a check that the refname is properly formatted Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/refs.c b/refs.c index 431d3c661d..752938c23c 100644 --- a/refs.c +++ b/refs.c @@ -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; }