Skip to content

Commit

Permalink
resolve_ref(): verify that the input refname has the right format
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Oct 5, 2011
1 parent d51b720 commit 8384d78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8384d78

Please sign in to comment.