diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-07-30 15:01:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-30 15:01:31 -0700 |
commit | 05bb78abc179b47f6288b990c1ba8f3d403cad1d (patch) | |
tree | 1a5dc09b15a2922a7596374fff1031b878d83cfc /connect.c | |
parent | 773e3a2e0226cffac6c813c2d3bea5ba480675d8 (diff) | |
parent | 0bfff8146f8c055fd95af4567286929ba8216fa7 (diff) | |
download | git-05bb78abc179b47f6288b990c1ba8f3d403cad1d.tar.gz |
Merge tag 'v2.10.4' into maint-2.11
Git 2.10.4
Diffstat (limited to 'connect.c')
-rw-r--r-- | connect.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -577,6 +577,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); @@ -759,6 +764,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); @@ -791,6 +799,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 = get_ssh_command(); if (!ssh) { const char *base; |