From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: "Duy Nguyen" <pclouds@gmail•com>, "René Scharfe" <l.s.r@web•de>,
"Git Mailing List" <git@vger•kernel.org>
Subject: Re: [PATCH v2 06/10] setup_git_env: use git_pathdup instead of xmalloc + sprintf
Date: Wed, 25 Jun 2014 12:54:38 -0700 [thread overview]
Message-ID: <xmqqtx789341.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140625172237.GA15294@sigill.intra.peff.net> (Jeff King's message of "Wed, 25 Jun 2014 13:22:38 -0400")
Jeff King <peff@peff•net> writes:
> On Wed, Jun 25, 2014 at 10:20:13AM -0700, Junio C Hamano wrote:
>
>> Jeff King <peff@peff•net> writes:
>>
>> > Here's a replacement patch that handles this (and just drops the ugly
>> > mallocs as a side effect).
>> >
>> > -- >8 --
>> > Subject: [PATCH] setup_git_env: copy getenv return value
>> >
>> > The return value of getenv is not guaranteed to survive
>> > across further invocations of setenv or even getenv. When we
>> > are assigning it to globals that last the lifetime of the
>> > program, we should make our own copy.
>> >
>> > Signed-off-by: Jeff King <peff@peff•net>
>> > ---
>>
>> Sigh. This mail unfortunately crossed with 64f25581 (Merge branch 'jk/xstrfmt'
>> into next, 2014-06-23) with about 20 hours of lag.
>
> Ah, sorry. I had checked yesterday that jk/xstrfmt hadn't been merged
> yet, but I didn't check when responding to Duy.
Sorry to have sighed --- crossing e-mails happen all the time. No
need to feel sorry.
>> I'd make it relative like the attached on top of the series. Note
>> that I tweaked the args to git_pathdup() to avoid the "are you sure
>> you want to give a variable format string to git_pathdup() which you
>> said is like printf(3)?" warning from the compiler.
>
> Both changes look good to me. Thanks for taking care of it.
Thanks.
next prev parent reply other threads:[~2014-06-25 19:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 20:00 [PATCH 0/2] dropping manual malloc calculations Jeff King
2014-06-18 20:01 ` [PATCH 1/2] strbuf: add xstrdup_fmt helper Jeff King
2014-06-18 22:32 ` Junio C Hamano
2014-06-19 9:05 ` Jeff King
2014-06-19 16:49 ` Junio C Hamano
2014-06-19 21:16 ` [PATCH v2] dropping manual malloc calculations Jeff King
2014-06-19 21:18 ` [PATCH v2 01/10] strbuf: add xstrfmt helper Jeff King
2014-06-19 21:19 ` [PATCH v2 02/10] use xstrfmt in favor of manual size calculations Jeff King
2014-06-19 21:19 ` [PATCH v2 03/10] use xstrdup instead of xmalloc + strcpy Jeff King
2014-06-19 21:24 ` [PATCH v2 04/10] use xstrfmt to replace xmalloc + sprintf Jeff King
2014-06-19 21:26 ` [PATCH v2 05/10] use xstrfmt to replace xmalloc + strcpy/strcat Jeff King
2014-06-19 21:28 ` [PATCH v2 06/10] setup_git_env: use git_pathdup instead of xmalloc + sprintf Jeff King
2014-06-23 10:21 ` Eric Sunshine
2014-06-23 22:43 ` Junio C Hamano
2014-06-24 13:02 ` Duy Nguyen
2014-06-24 13:30 ` Duy Nguyen
2014-06-24 20:58 ` Jeff King
2014-06-25 12:37 ` Duy Nguyen
2014-06-25 17:20 ` Junio C Hamano
2014-06-25 17:22 ` Jeff King
2014-06-25 19:54 ` Junio C Hamano [this message]
2014-06-19 21:28 ` [PATCH v2 07/10] sequencer: use argv_array_pushf Jeff King
2014-06-19 21:29 ` [PATCH v2 08/10] merge: use argv_array when spawning merge strategy Jeff King
2014-06-19 21:29 ` [PATCH v2 09/10] walker_fetch: fix minor memory leak Jeff King
2014-06-19 21:30 ` [PATCH v2 10/10] unique_path: fix unlikely heap overflow Jeff King
2014-06-19 16:52 ` [PATCH 1/2] strbuf: add xstrdup_fmt helper René Scharfe
2014-06-18 20:02 ` [PATCH 2/2] use xstrdup_fmt in favor of manual size calculations Jeff King
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=xmqqtx789341.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=l.s.r@web$(echo .)de \
--cc=pclouds@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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