1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

resolve_ref(): verify that the input refname has the right format

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-09-15 23:10:39 +02:00 committed by Junio C Hamano
parent d51b720fca
commit 8384d78886

3
refs.c
View file

@ -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;