diff options
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | 2008-01-04 20:37:17 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-01-04 15:59:43 -0800 |
commit | 061d6b9a7bfcf88ff3895aa1be8424ae1647cbca (patch) | |
tree | 7c1cf7bdecb9f5ef380b256916ea4c584f50755d | |
parent | 872c930dcb048c1a2b50e6ce881c521dcee15e23 (diff) | |
download | git-061d6b9a7bfcf88ff3895aa1be8424ae1647cbca.tar.gz git-061d6b9a7bfcf88ff3895aa1be8424ae1647cbca.tar.xz |
receive-pack: reject invalid refnames
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | receive-pack.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/receive-pack.c b/receive-pack.c index d0a563df6..326749583 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"; } |