diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2011-09-15 23:10:39 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-05 13:45:31 -0700 |
commit | 8384d78886eca05cae2a4c1bccaee379d76c1e06 (patch) | |
tree | ef6710f2ad28d3b23c94c43d1d5fbdc1210362a0 | |
parent | remote: avoid passing NULL to read_ref() (diff) | |
download | tgif-8384d78886eca05cae2a4c1bccaee379d76c1e06.tar.xz |
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>
-rw-r--r-- | refs.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |