git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] daemon: parse_host_and_port SIGSEGV if port is specified

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 20, 2010, 15:49 UTC
Message-ID
<7vk4t7kn7g.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1269051838-25734-1-git-send-email-imre.deak@nokia.com>
imre.deak@nokia.com writes:
Show 18 quoted lines
> From: Imre Deak <imre.deak@gmail.com>
>
> 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 <imre.deak@gmail.com>
> ---
I wonder why I have this feeling that I've seen this patch before...
Thanks.
Show 18 quoted lines
>  daemon.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/daemon.c b/daemon.c
> index 3769b6f..7d9e1c0 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;
>  		}
>  	}
> -- 
> 1.7.0.2
Previous: imre.deak@nokia.com
Message 2 of 2 in “daemon: parse_host_and_port SIGSEGV if port is specified”
  1. daemon: parse_host_and_port SIGSEGV if port is specifiedimre.deak@nokia.com, Mar 20, 2010
  2. Junio C HamanoMar 20, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.