summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-30 21:46:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-07-30 21:46:43 (GMT)
commit7720c33f632c2d67b53169030a7ed2e0e6ae8fde (patch)
tree7132d4b21e8be0e2dd1bc322f092b96e1426c488 /connect.c
parentcd0887327544ecdc8778e16219aec3f43b0dd682 (diff)
parent5e0649dc65fe33e8cf38823350e9d7951f6a6346 (diff)
downloadgit-7720c33f632c2d67b53169030a7ed2e0e6ae8fde.zip
git-7720c33f632c2d67b53169030a7ed2e0e6ae8fde.tar.gz
git-7720c33f632c2d67b53169030a7ed2e0e6ae8fde.tar.bz2
Merge tag 'v2.7.6' into maint-2.8
Git 2.7.6
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/connect.c b/connect.c
index c53f3f1..c75bf52 100644
--- a/connect.c
+++ b/connect.c
@@ -557,6 +557,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);
@@ -726,6 +731,9 @@ struct child_process *git_connect(int fd[2], const char *url,
conn = xmalloc(sizeof(*conn));
child_process_init(conn);
+ if (looks_like_command_line_option(path))
+ die("strange pathname '%s' blocked", path);
+
strbuf_addstr(&cmd, prog);
strbuf_addch(&cmd, ' ');
sq_quote_buf(&cmd, path);
@@ -758,6 +766,9 @@ struct child_process *git_connect(int fd[2], const char *url,
return NULL;
}
+ if (looks_like_command_line_option(ssh_host))
+ die("strange hostname '%s' blocked", ssh_host);
+
ssh = getenv("GIT_SSH_COMMAND");
if (!ssh) {
const char *base;