Jeff King writes:
> So actually, that's pretty easy to do without writing much code at all.
> Something like:
>
> #define xgetenv(name) strintern(getenv(name))
>
> It means we're effectively storing the environment twice in the worst
> case, but that's probably not a big deal. Unless we have a
On Tue, Jan 15, 2019 at 02:41:42PM -0500, Jeff King wrote:
> The more involved one (that doesn't pass along memory ownership) is
> something like:
>
> static struct hashmap env_cache;
>
> const char *getenv_safe(const char *name)
> {
>
> if (e = hashmap_get(&env_cache, name))
>
On Tue, Jan 15, 2019 at 11:32:56AM -0800, Junio C Hamano wrote:
> Jeff King writes:
>
> > On Sat, Jan 12, 2019 at 10:51:42AM -0800, Stefan Beller wrote:
> >
> >> > I wonder, and not as "you should do this" feedback on this series, just
> >>
> >> There is a getenv_safe() in environment.c, but I
On Tue, Jan 15, 2019 at 11:32 AM Junio C Hamano wrote:
>
> Jeff King writes:
>
> > On Sat, Jan 12, 2019 at 10:51:42AM -0800, Stefan Beller wrote:
> >
> >> > I wonder, and not as "you should do this" feedback on this series, just
> >>
> >> There is a getenv_safe() in environment.c, but I guess a x
Jeff King writes:
> On Sat, Jan 12, 2019 at 10:51:42AM -0800, Stefan Beller wrote:
>
>> > I wonder, and not as "you should do this" feedback on this series, just
>>
>> There is a getenv_safe() in environment.c, but I guess a xgetenv() that
>> takes the same parameters as getenv() is better for e
On Sat, Jan 12, 2019 at 10:51:42AM -0800, Stefan Beller wrote:
> > I wonder, and not as "you should do this" feedback on this series, just
>
> There is a getenv_safe() in environment.c, but I guess a xgetenv() that
> takes the same parameters as getenv() is better for ease of use.
Yes, but it pu
On Sat, Jan 12, 2019 at 12:31:21PM +0100, Ævar Arnfjörð Bjarmason wrote:
> > So anyway. Here are a handful of what seem like pretty low-hanging
> > fruit. Beyond the first one, I'm not sure if they're triggerable, but
> > they're easy to fix. There are 100+ grep matches that I _didn't_ audit,
> >
> I wonder, and not as "you should do this" feedback on this series, just
There is a getenv_safe() in environment.c, but I guess a xgetenv() that
takes the same parameters as getenv() is better for ease of use.
On Fri, Jan 11 2019, Jeff King wrote:
> Similar to the recent:
>
> https://public-inbox.org/git/20190109221007.21624-1-kgyb...@infogroep.be/
>
> there are some other places where we do not follow the POSIX rule that
> getenv()'s return value may be invalidated by other calls to getenv() or
> s
Similar to the recent:
https://public-inbox.org/git/20190109221007.21624-1-kgyb...@infogroep.be/
there are some other places where we do not follow the POSIX rule that
getenv()'s return value may be invalidated by other calls to getenv() or
setenv().
For the most part we haven't noticed becaus
10 matches
Mail list logo