提交 e9bd3235 编写于 作者: I Imre Deak 提交者: Junio C Hamano

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://...:<port>.

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: NImre Deak <imre.deak@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 c40d92e4
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册