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-05 00:59:43 +0100 |
commit | 061d6b9a7bfcf88ff3895aa1be8424ae1647cbca (patch) | |
tree | 7c1cf7bdecb9f5ef380b256916ea4c584f50755d | |
parent | Don't access line[-1] for a zero-length "line" from fgets. (diff) | |
download | git-061d6b9a7bfcf88ff3895aa1be8424ae1647cbca.tar.xz git-061d6b9a7bfcf88ff3895aa1be8424ae1647cbca.zip |
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 d0a563df64..3267495832 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"; } |