mirror of
https://github.com/git/git.git
synced 2024-10-28 12:59:41 +01:00
receive-pack: reject invalid refnames
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
872c930dcb
commit
061d6b9a7b
1 changed files with 2 additions and 1 deletions
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue