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

Mike Frysinger vapier@gentoo.org
Tue Jul 28 03:19:00 GMT 2015


On 27 Jul 2015 17:18, Florian Weimer wrote:
> -      int i;
> -
> -      for (i = 0 ; gr->gr_mem[i] != NULL; i++)
> +      for (size_t i = 0 ; gr->gr_mem[i] != NULL; i++)

if you're tweaking style(ish), should trim the space before the first ; too


> --- /dev/null
> +++ b/grp/tst-putgrent.c
>
> +      ++errors;
> ...
> +  return errors > 0;

is an error count really necessary ?  just make it a bool.
<paranoid>don't want it to overflow</paranoid>

> +check (const char *what, _Bool expr)

why not "bool" ?
-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/d07692b7/attachment.sig>


More information about the Libc-alpha mailing list