[PATCH] Harden put*ent functions against data injection [BZ #18724]

Mike Frysinger vapier@gentoo.org
Tue Jul 28 15:50:00 GMT 2015


On 28 Jul 2015 14:30, Florian Weimer wrote:
> On 07/28/2015 05:19 AM, Mike Frysinger wrote:
> > On 27 Jul 2015 17:18, Florian Weimer wrote:
> >> --- /dev/null
> >> +++ b/grp/tst-putgrent.c
> >>
> >> +      ++errors;
> >> ...
> >> +  return errors > 0;
> > 
> > is an error count really necessary ?  just make it a bool.
> 
> “++errors;” is clearer to me than “errors |= true;”.  Other test suite
> code uses the counter approach, too.

i meant:
	error = true;
or:
	error = 1;

there's no point in using |= operations here

> >> +check (const char *what, _Bool expr)
> > 
> > why not "bool" ?
> 
> It requires #include <stdbool.h>.

so ?  include it then.  better imo than using private _Bool types.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150728/e7ff480c/attachment.sig>


More information about the Libc-alpha mailing list