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
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)
|
if (flag)
|
||||||
*flag = 0;
|
*flag = 0;
|
||||||
|
|
||||||
|
if (check_refname_format(ref, REFNAME_ALLOW_ONELEVEL))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
Loading…
Reference in New Issue
Block a user