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

Re: [PATCH] Don't crash if ai_canonname comes back as null

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 29, 2009, 23:21 UTC
Message-ID
<7v63gn59mw.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<C2AC0D7A-3E11-4A3A-8447-5D7582547B13@gmail.com>
Augie Fackler <durin42@gmail.com> writes:
> Fixes a weird bug where git-daemon was segfaulting
> when started by sh(1) because ai_canonname was null.
> ---
> Fixed based on feedback.
Hmm.

I've been waiting for feedback to a patch proposed earlier in the same area, which is <49F5BA55.3060606@googlemail.com> ($gmane/117670). How does this new one relate to it?

Show 20 quoted lines
>  daemon.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/daemon.c b/daemon.c
> index 13401f1..ae21d92 100644
> --- a/daemon.c
> +++ b/daemon.c
> @@ -459,7 +459,7 @@ static void parse_extra_args(char *extra_args, int
> buflen)
>  				inet_ntop(AF_INET, &sin_addr->sin_addr,
>  					  addrbuf, sizeof(addrbuf));
>  				free(canon_hostname);
> -				canon_hostname = xstrdup(ai->ai_canonname);
> +				canon_hostname = ai->ai_canonname ?
> xstrdup(ai->ai_canonname) : NULL;
>  				free(ip_address);
>  				ip_address = xstrdup(addrbuf);
>  				break;
> --
> 1.6.2.GIT
Previous: Augie FacklerNext: Augie Fackler
Message 7 of 11 in “Workaround for ai_canonname sometimes coming back as null”
  1. Workaround for ai_canonname sometimes coming back as nullAugie Fackler, Apr 29, 2009
  2. Alex RiesenApr 29, 2009
  3. Augie FacklerApr 29, 2009
  4. Alex RiesenApr 29, 2009
  5. Alex RiesenApr 29, 2009
  6. Don't crash if ai_canonname comes back as nullAugie Fackler, Apr 29, 2009
  7. Junio C HamanoApr 29, 2009
  8. Augie FacklerApr 29, 2009
  9. Jon LoeligerApr 30, 2009
  10. Junio C HamanoApr 30, 2009
  11. Alex RiesenApr 29, 2009

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.