summaryrefslogtreecommitdiff
path: root/receive-pack.c
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2008-01-04 19:37:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-01-04 23:59:43 (GMT)
commit061d6b9a7bfcf88ff3895aa1be8424ae1647cbca (patch)
tree7c1cf7bdecb9f5ef380b256916ea4c584f50755d /receive-pack.c
parent872c930dcb048c1a2b50e6ce881c521dcee15e23 (diff)
downloadgit-061d6b9a7bfcf88ff3895aa1be8424ae1647cbca.zip
git-061d6b9a7bfcf88ff3895aa1be8424ae1647cbca.tar.gz
git-061d6b9a7bfcf88ff3895aa1be8424ae1647cbca.tar.bz2
receive-pack: reject invalid refnames
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'receive-pack.c')
-rw-r--r--receive-pack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/receive-pack.c b/receive-pack.c
index d0a563d..3267495 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -165,7 +165,8 @@ static const char *update(struct command *cmd)
unsigned char *new_sha1 = cmd->new_sha1;
struct ref_lock *lock;
- if (!prefixcmp(name, "refs/") && check_ref_format(name + 5)) {
+ /* only refs/... are allowed */
+ if (prefixcmp(name, "refs/") || check_ref_format(name + 5)) {
error("refusing to create funny ref '%s' remotely", name);
return "funny refname";
}