From: Michael Haggerty Date: Thu, 15 Sep 2011 21:10:39 +0000 (+0200) Subject: resolve_ref(): verify that the input refname has the right format X-Git-Tag: v1.7.8-rc0~19^2~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8384d78886eca05cae2a4c1bccaee379d76c1e06;p=git.git resolve_ref(): verify that the input refname has the right format Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index b05550189..ee3e0cc56 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;