{"thread":{"id":"23099","subject":"[PATCH] daemon: parse_host_and_port SIGSEGV if port is specified","startedAt":"2010-03-20T02:23:58Z","lastAt":"2010-03-20T15:49:23Z","messageCount":2,"participants":["imre.deak@nokia.com","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"137297","messageId":"1269051838-25734-1-git-send-email-imre.deak@nokia.com","threadId":"23099","inReplyTo":null,"subject":"[PATCH] daemon: parse_host_and_port SIGSEGV if port is specified","fromName":"","fromEmail":"imre.deak@nokia.com","sentAt":"2010-03-20T02:23:58Z","receivedAt":"2010-03-20T02:23:58Z","isPatch":true,"sender":{"key":"imre.deak@nokia.com","avatar":null},"body":"From: Imre Deak <imre.deak@gmail.com>\n\nThis typo will lead to git-daemon dying any time the connect\nstring includes a port after the host= attribute. This can lead\nfor example to one of the following error messages on the client\nside when someone tries git clone git://...:<port>.\n\nWhen the daemon is running on localhost:\n  fatal: The remote end hung up unexpectedly\n\nor when the daemon is connected through an ssh tunnel:\n  fatal: protocol error: bad line length character: erro\n\nIn the latter case 'erro' comes from the daemon's reply:\n  error: git-daemon died of signal 11\n\nSigned-off-by: Imre Deak <imre.deak@gmail.com>\n---\n daemon.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/daemon.c b/daemon.c\nindex 3769b6f..7d9e1c0 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -420,7 +420,7 @@ static void parse_host_and_port(char *hostport, char **host,\n \t\t*host = hostport;\n \t\t*port = strrchr(hostport, ':');\n \t\tif (*port) {\n-\t\t\t*port = '\\0';\n+\t\t\t**port = '\\0';\n \t\t\t++*port;\n \t\t}\n \t}\n-- \n1.7.0.2\n"},{"id":"137341","messageId":"7vk4t7kn7g.fsf@alter.siamese.dyndns.org","threadId":"23099","inReplyTo":"1269051838-25734-1-git-send-email-imre.deak@nokia.com","subject":"Re: [PATCH] daemon: parse_host_and_port SIGSEGV if port is specified","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-20T15:49:23Z","receivedAt":"2010-03-20T15:49:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"imre.deak@nokia.com writes:\n\n> From: Imre Deak <imre.deak@gmail.com>\n>\n> This typo will lead to git-daemon dying any time the connect\n> string includes a port after the host= attribute. This can lead\n> for example to one of the following error messages on the client\n> side when someone tries git clone git://...:<port>.\n>\n> When the daemon is running on localhost:\n>   fatal: The remote end hung up unexpectedly\n>\n> or when the daemon is connected through an ssh tunnel:\n>   fatal: protocol error: bad line length character: erro\n>\n> In the latter case 'erro' comes from the daemon's reply:\n>   error: git-daemon died of signal 11\n>\n> Signed-off-by: Imre Deak <imre.deak@gmail.com>\n> ---\n\nI wonder why I have this feeling that I've seen this patch before...\n\nThanks.\n\n>  daemon.c |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/daemon.c b/daemon.c\n> index 3769b6f..7d9e1c0 100644\n> --- a/daemon.c\n> +++ b/daemon.c\n> @@ -420,7 +420,7 @@ static void parse_host_and_port(char *hostport, char **host,\n>  \t\t*host = hostport;\n>  \t\t*port = strrchr(hostport, ':');\n>  \t\tif (*port) {\n> -\t\t\t*port = '\\0';\n> +\t\t\t**port = '\\0';\n>  \t\t\t++*port;\n>  \t\t}\n>  \t}\n> -- \n> 1.7.0.2\n"}]}