Skip to content

Commit e9bd323

Browse files
ideakgitster
authored andcommitted
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: Imre Deak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c40d92e commit e9bd323

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

daemon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static void parse_host_and_port(char *hostport, char **host,
420420
*host = hostport;
421421
*port = strrchr(hostport, ':');
422422
if (*port) {
423-
*port = '\0';
423+
**port = '\0';
424424
++*port;
425425
}
426426
}

0 commit comments

Comments
 (0)