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
@ -165,7 +165,8 @@ static const char *update(struct command *cmd)
|
|||||||
unsigned char *new_sha1 = cmd->new_sha1;
|
unsigned char *new_sha1 = cmd->new_sha1;
|
||||||
struct ref_lock *lock;
|
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);
|
error("refusing to create funny ref '%s' remotely", name);
|
||||||
return "funny refname";
|
return "funny refname";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user