Re: [PATCH] vasnprintf: fix potential use after free

2014-12-08 Thread Paul Eggert
On 12/08/2014 07:24 AM, Eric Blake wrote: It might make sense to have a variant of 'free' that preserves errno, >but we should probably give the variant a different name. 'noerr_free', >say. I'm not sure a variant is needed; if we can get glibc to guarantee the POSIX proposal now, then we would

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-08 Thread Eric Blake
On 12/07/2014 07:29 PM, Paul Eggert wrote: > Pádraig Brady wrote: >> BTW if free() may reset errno on some platforms then it's >> probably worth augmenting the gnulib free() wrapper >> to restore errno if needed, > > The documented GNU behavior for 'free' allows 'free' to set errno, > right? So w

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-08 Thread Pádraig Brady
On 08/12/14 02:29, Paul Eggert wrote: > Pádraig Brady wrote: >> BTW if free() may reset errno on some platforms then it's >> probably worth augmenting the gnulib free() wrapper >> to restore errno if needed, > > The documented GNU behavior for 'free' allows 'free' to set errno, right? So > why s

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-07 Thread Paul Eggert
Pádraig Brady wrote: BTW if free() may reset errno on some platforms then it's probably worth augmenting the gnulib free() wrapper to restore errno if needed, The documented GNU behavior for 'free' allows 'free' to set errno, right? So why should the corresponding gnulib wrapper guarantee beh

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-06 Thread Pádraig Brady
On 06/12/14 16:06, Pádraig Brady wrote: > On 06/12/14 02:46, Eric Blake wrote: >> On 12/05/2014 06:23 PM, Pádraig Brady wrote: >>> * lib/vasnprintf.c (VASNPRINTF): Fix free-memory read, >>> flagged by clang-analyzer 3.4.2. >>> --- >>> ChangeLog| 6 ++ >>> lib/vasnprintf.c | 2 +- >>> 2

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-06 Thread Pádraig Brady
On 06/12/14 02:46, Eric Blake wrote: > On 12/05/2014 06:23 PM, Pádraig Brady wrote: >> * lib/vasnprintf.c (VASNPRINTF): Fix free-memory read, >> flagged by clang-analyzer 3.4.2. >> --- >> ChangeLog| 6 ++ >> lib/vasnprintf.c | 2 +- >> 2 files changed, 7 insertions(+), 1 deletion(-) >>

Re: [PATCH] vasnprintf: fix potential use after free

2014-12-05 Thread Eric Blake
On 12/05/2014 06:23 PM, Pádraig Brady wrote: > * lib/vasnprintf.c (VASNPRINTF): Fix free-memory read, > flagged by clang-analyzer 3.4.2. > --- > ChangeLog| 6 ++ > lib/vasnprintf.c | 2 +- > 2 files changed, 7 insertions(+), 1 deletion(-) > > +++ b/lib/vasnprintf.c > @@ -5184,13 +518

[PATCH] vasnprintf: fix potential use after free

2014-12-05 Thread Pádraig Brady
* lib/vasnprintf.c (VASNPRINTF): Fix free-memory read, flagged by clang-analyzer 3.4.2. --- ChangeLog| 6 ++ lib/vasnprintf.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1c4a7ab..41207ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,