@@ -577,6 +577,11 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
577
577
578
578
get_host_and_port (& host , & port );
579
579
580
+ if (looks_like_command_line_option (host ))
581
+ die ("strange hostname '%s' blocked" , host );
582
+ if (looks_like_command_line_option (port ))
583
+ die ("strange port '%s' blocked" , port );
584
+
580
585
proxy = xmalloc (sizeof (* proxy ));
581
586
child_process_init (proxy );
582
587
argv_array_push (& proxy -> args , git_proxy_command );
@@ -759,6 +764,9 @@ struct child_process *git_connect(int fd[2], const char *url,
759
764
conn = xmalloc (sizeof (* conn ));
760
765
child_process_init (conn );
761
766
767
+ if (looks_like_command_line_option (path ))
768
+ die ("strange pathname '%s' blocked" , path );
769
+
762
770
strbuf_addstr (& cmd , prog );
763
771
strbuf_addch (& cmd , ' ' );
764
772
sq_quote_buf (& cmd , path );
@@ -791,6 +799,9 @@ struct child_process *git_connect(int fd[2], const char *url,
791
799
return NULL ;
792
800
}
793
801
802
+ if (looks_like_command_line_option (ssh_host ))
803
+ die ("strange hostname '%s' blocked" , ssh_host );
804
+
794
805
ssh = get_ssh_command ();
795
806
if (!ssh ) {
796
807
const char * base ;
0 commit comments