connect: reject dashed arguments for proxy commands
[gitweb.git] / connect.c
index a0091acb1f06a8af6fc34fc6d5c474cb633d3827..bdf2ca08acdbf6c551b782ece5ebc8c5f15b35e9 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -553,6 +553,11 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
 
        get_host_and_port(&host, &port);
 
+       if (looks_like_command_line_option(host))
+               die("strange hostname '%s' blocked", host);
+       if (looks_like_command_line_option(port))
+               die("strange port '%s' blocked", port);
+
        proxy = xmalloc(sizeof(*proxy));
        child_process_init(proxy);
        argv_array_push(&proxy->args, git_proxy_command);