From: Martin Koegler Date: Fri, 4 Jan 2008 19:37:17 +0000 (+0100) Subject: receive-pack: reject invalid refnames X-Git-Tag: v1.5.4-rc3~54 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=061d6b9a7bfcf88ff3895aa1be8424ae1647cbca;p=git.git receive-pack: reject invalid refnames Signed-off-by: Martin Koegler Signed-off-by: Junio C Hamano --- 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"; }