From: Alex Riesen <raa.lkml@gmail.com>
To: Augie Fackler <durin42@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Workaround for ai_canonname sometimes coming back as null
Date: Wed, 29 Apr 2009 23:55:01 +0200 [thread overview]
Message-ID: <81b0412b0904291455n47f83e9ftcbdec0ff1c0ea03@mail.gmail.com> (raw)
In-Reply-To: <9C355DCC-0240-4B9E-83CA-083B51C2E34C@gmail.com>
2009/4/29 Augie Fackler <durin42@gmail.com>:
> @@ -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);
next prev parent reply other threads:[~2009-04-29 21:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-29 21:48 [PATCH] Workaround for ai_canonname sometimes coming back as null Augie Fackler
2009-04-29 21:55 ` Alex Riesen [this message]
2009-04-29 21:56 ` Augie Fackler
2009-04-29 22:01 ` Alex Riesen
2009-04-29 22:04 ` Alex Riesen
2009-04-29 23:04 ` [PATCH] Don't crash if ai_canonname comes " Augie Fackler
2009-04-29 23:21 ` Junio C Hamano
2009-04-29 23:32 ` Augie Fackler
2009-04-30 14:13 ` Jon Loeliger
2009-04-30 16:57 ` Junio C Hamano
2009-04-29 21:56 ` [PATCH] Workaround for ai_canonname sometimes coming " Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81b0412b0904291455n47f83e9ftcbdec0ff1c0ea03@mail.gmail.com \
--to=raa.lkml@gmail.com \
--cc=durin42@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).