From: Michael Haggerty Date: Wed, 27 Apr 2016 10:42:27 +0000 (+0200) Subject: refname_is_safe(): don't allow the empty string X-Git-Tag: v2.10.0-rc0~98^2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35db25c65f6f77c153ef2b1183ea7821236201c8;p=git refname_is_safe(): don't allow the empty string Signed-off-by: Michael Haggerty --- diff --git a/refs.c b/refs.c index 5789152743..ca0280f7eb 100644 --- a/refs.c +++ b/refs.c @@ -136,11 +136,12 @@ int refname_is_safe(const char *refname) free(buf); return result; } - while (*refname) { + + do { if (!isupper(*refname) && *refname != '_') return 0; refname++; - } + } while (*refname); return 1; }