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:
parent
d51b720fca
commit
8384d78886
1 changed files with 3 additions and 0 deletions
3
refs.c
3
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;
|
||||
|
|
Loading…
Reference in a new issue