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: Thu, 30 Apr 2009 00:01:28 +0200 [thread overview]
Message-ID: <81b0412b0904291501w501eecd4y18927018d57bdbdc@mail.gmail.com> (raw)
In-Reply-To: <6B7EA51D-8412-4E6A-BA7B-156FD5B755E8@gmail.com>
2009/4/29 Augie Fackler <durin42@gmail.com>:
> On Apr 29, 2009, at 4:55 PM, Alex Riesen wrote:
>> 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:
>>
>
> Odd, because I'm running with that exact code and not seeing the problem.
> Should I resubmit an updated patch that xstrdup's unknown into
> canon_hostname?
>
I think you can just let canon_hostname be NULL (i.e. don't strdup it,
if ai_canonname is NULL). NULL values of canon_hostname seem
to be handled just fine: see path_ok and strbuf_expand_dict_cb (strbuf.c)
next prev parent reply other threads:[~2009-04-29 22:02 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
2009-04-29 21:56 ` Augie Fackler
2009-04-29 22:01 ` Alex Riesen [this message]
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=81b0412b0904291501w501eecd4y18927018d57bdbdc@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).