@@ -557,6 +557,11 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
557
557
558
558
get_host_and_port (& host , & port );
559
559
560
+ if (looks_like_command_line_option (host ))
561
+ die ("strange hostname '%s' blocked" , host );
562
+ if (looks_like_command_line_option (port ))
563
+ die ("strange port '%s' blocked" , port );
564
+
560
565
proxy = xmalloc (sizeof (* proxy ));
561
566
child_process_init (proxy );
562
567
argv_array_push (& proxy -> args , git_proxy_command );
@@ -739,6 +744,9 @@ struct child_process *git_connect(int fd[2], const char *url,
739
744
conn = xmalloc (sizeof (* conn ));
740
745
child_process_init (conn );
741
746
747
+ if (looks_like_command_line_option (path ))
748
+ die ("strange pathname '%s' blocked" , path );
749
+
742
750
strbuf_addstr (& cmd , prog );
743
751
strbuf_addch (& cmd , ' ' );
744
752
sq_quote_buf (& cmd , path );
@@ -771,6 +779,9 @@ struct child_process *git_connect(int fd[2], const char *url,
771
779
return NULL ;
772
780
}
773
781
782
+ if (looks_like_command_line_option (ssh_host ))
783
+ die ("strange hostname '%s' blocked" , ssh_host );
784
+
774
785
ssh = get_ssh_command ();
775
786
if (!ssh ) {
776
787
const char * base ;
0 commit comments