* [PATCH] daemon: parse_host_and_port SIGSEGV if port is specified
@ 2010-03-20 2:23 imre.deak
2010-03-20 15:49 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: imre.deak @ 2010-03-20 2:23 UTC (permalink / raw)
To: git; +Cc: Imre Deak
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] daemon: parse_host_and_port SIGSEGV if port is specified
2010-03-20 2:23 [PATCH] daemon: parse_host_and_port SIGSEGV if port is specified imre.deak
@ 2010-03-20 15:49 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2010-03-20 15:49 UTC (permalink / raw)
To: imre.deak; +Cc: git, Imre Deak
imre.deak@nokia.com writes:
> 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.
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-20 15:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-20 2:23 [PATCH] daemon: parse_host_and_port SIGSEGV if port is specified imre.deak
2010-03-20 15:49 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).