From 7ad994bb6061779d3893f23fea43262d8eb24f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 1 Oct 2011 13:41:16 +0200 Subject: [PATCH] transport-git: fix git request length calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was an off-by-one error that was uncovered when we used the right length from git_buf. Signed-off-by: Carlos Martín Nieto --- src/transport_git.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transport_git.c b/src/transport_git.c index b9fe658cb..b8a41379a 100644 --- a/src/transport_git.c +++ b/src/transport_git.c @@ -56,7 +56,7 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url) if (cmd == NULL) cmd = default_command; - len = 4 + strlen(cmd) + 1 + strlen(repo) + 1 + strlen(host) + (delim - url) + 1 + 1; + len = 4 + strlen(cmd) + 1 + strlen(repo) + 1 + strlen(host) + (delim - url) + 1; git_buf_grow(request, len); git_buf_printf(request, "%04x%s %s%c%s", len, cmd, repo, 0, host);