From 061d6b9a7bfcf88ff3895aa1be8424ae1647cbca Mon Sep 17 00:00:00 2001 From: Martin Koegler Date: Fri, 4 Jan 2008 20:37:17 +0100 Subject: [PATCH] receive-pack: reject invalid refnames Signed-off-by: Martin Koegler Signed-off-by: Junio C Hamano --- receive-pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"; } -- 2.30.2