Skip to content

Commit 8384d78

Browse files
mhaggergitster
authored andcommitted
resolve_ref(): verify that the input refname has the right format
Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d51b720 commit 8384d78

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

refs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *
504504
if (flag)
505505
*flag = 0;
506506

507+
if (check_refname_format(ref, REFNAME_ALLOW_ONELEVEL))
508+
return NULL;
509+
507510
for (;;) {
508511
char path[PATH_MAX];
509512
struct stat st;

0 commit comments

Comments
 (0)