From: Imre Deak Date: Sat, 20 Mar 2010 02:23:58 +0000 (+0200) Subject: daemon: parse_host_and_port SIGSEGV if port is specified X-Git-Tag: v1.7.0.3~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e9bd32351078d1f664a1608763a92ab402b255f0;p=git.git daemon: parse_host_and_port SIGSEGV if port is specified This typo will lead to git-daemon dying any time the connect string includes a port after the host= attribute. This can lead for example to one of the following error messages on the client side when someone tries git clone git://...:. When the daemon is running on localhost: fatal: The remote end hung up unexpectedly or when the daemon is connected through an ssh tunnel: fatal: protocol error: bad line length character: erro In the latter case 'erro' comes from the daemon's reply: error: git-daemon died of signal 11 Signed-off-by: Imre Deak Signed-off-by: Junio C Hamano --- diff --git a/daemon.c b/daemon.c index 3769b6f57..7d9e1c03e 100644 --- a/daemon.c +++ b/daemon.c @@ -420,7 +420,7 @@ static void parse_host_and_port(char *hostport, char **host, *host = hostport; *port = strrchr(hostport, ':'); if (*port) { - *port = '\0'; + **port = '\0'; ++*port; } }