diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2016-04-27 13:42:27 +0300 |
---|---|---|
committer | Michael Haggerty <mhagger@alum.mit.edu> | 2016-05-05 17:37:30 +0300 |
commit | 35db25c65f6f77c153ef2b1183ea7821236201c8 (patch) | |
tree | b6dd00bcd105e094e26949136b92cb1c771f4221 /refs.c | |
parent | 39950fef8bb45e944655e48393ee04c0b33211f5 (diff) |
refname_is_safe(): don't allow the empty string
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |