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

Re: [PATCH] Workaround for ai_canonname sometimes coming back as null

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 29, 2009, 21:55 UTC
Message-ID
<81b0412b0904291455n47f83e9ftcbdec0ff1c0ea03@mail.gmail.com>
In-Reply-To
<9C355DCC-0240-4B9E-83CA-083B51C2E34C@gmail.com>
2009/4/29 Augie Fackler <durin42@gmail.com>:
Show 11 quoted lines
> @@ -459,7 +459,10 @@ 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);
> +                               if (ai->ai_canonname)
> +                                       canon_hostname =
> xstrdup(ai->ai_canonname);
> +                               else
> +                                       canon_hostname = "unknown";
This last line will crash some lines down, when canon_hostname is free'd:
		inet_ntop(hent->h_addrtype, &sa.sin_addr,
			  addrbuf, sizeof(addrbuf));
		free(canon_hostname); /* CRASH */
		canon_hostname = xstrdup(hent->h_name);
		free(ip_address);
Previous: Augie FacklerNext: Augie Fackler
Message 2 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.