]> git.ipfire.org Git - thirdparty/git.git/blobdiff - connect.c
t3905: use test_cmp() to check file contents
[thirdparty/git.git] / connect.c
index 8b8f56cf6d230b23c46bb980755cb6d1fc3684ef..9c97fee43031056dff2beb2a8fe9ed882e476c2d 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -1160,6 +1160,8 @@ static struct child_process *git_connect_git(int fd[2], char *hostandport,
                target_host = xstrdup(hostandport);
 
        transport_check_allowed("git");
+       if (strchr(target_host, '\n') || strchr(path, '\n'))
+               die(_("newline is forbidden in git:// hosts and repo paths"));
 
        /*
         * These underlying connection commands die() if they