Re: [PATCH 1/1] mingw: safe-guard a bit more against getenv() problems

2019-02-21 Thread Jeff King
On Mon, Feb 18, 2019 at 07:57:14PM +0100, Johannes Schindelin wrote: > > Why not use a mem_pool for this? We have that code isolated > > and re-usable now. Have mingw_getenv() copy the string into > > the pool always return the pointer from within the pool. The > > pool automatically handles al

Re: [PATCH 1/1] mingw: safe-guard a bit more against getenv() problems

2019-02-21 Thread Jeff King
On Fri, Feb 15, 2019 at 07:17:45AM -0800, Johannes Schindelin via GitGitGadget wrote: > From: Johannes Schindelin > > Running up to v2.21.0, we fixed two bugs that were made prominent by the > Windows-specific change to retain copies of only the 30 latest getenv() > calls' returned strings, inv

Re: [PATCH 1/1] mingw: safe-guard a bit more against getenv() problems

2019-02-18 Thread Johannes Schindelin
Hi Jeff, On Fri, 15 Feb 2019, Jeff Hostetler wrote: > On 2/15/2019 10:17 AM, Johannes Schindelin via GitGitGadget wrote: > > From: Johannes Schindelin > > > > diff --git a/compat/mingw.c b/compat/mingw.c > > index 4276297595..8141f77189 100644 > > --- a/compat/mingw.c > > +++ b/compat/mingw.c >

Re: [PATCH 1/1] mingw: safe-guard a bit more against getenv() problems

2019-02-15 Thread Junio C Hamano
Jeff Hostetler writes: >> diff --git a/compat/mingw.c b/compat/mingw.c >> index 4276297595..8141f77189 100644 >> --- a/compat/mingw.c >> +++ b/compat/mingw.c >> @@ -1632,7 +1632,7 @@ int mingw_kill(pid_t pid, int sig) >>*/ >> char *mingw_getenv(const char *name) >> { >> -#define GETENV_MA

Re: [PATCH 1/1] mingw: safe-guard a bit more against getenv() problems

2019-02-15 Thread Jeff Hostetler
On 2/15/2019 10:17 AM, Johannes Schindelin via GitGitGadget wrote: From: Johannes Schindelin Running up to v2.21.0, we fixed two bugs that were made prominent by the Windows-specific change to retain copies of only the 30 latest getenv() calls' returned strings, invalidating any copies of pr

[PATCH 1/1] mingw: safe-guard a bit more against getenv() problems

2019-02-15 Thread Johannes Schindelin via GitGitGadget
From: Johannes Schindelin Running up to v2.21.0, we fixed two bugs that were made prominent by the Windows-specific change to retain copies of only the 30 latest getenv() calls' returned strings, invalidating any copies of previous getenv() calls' return values. While this really shines a light