This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Harden put*ent functions against data injection [BZ #18724]
- From: Andreas Schwab <schwab at suse dot de>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 28 Jul 2015 18:06:49 +0200
- Subject: Re: [PATCH] Harden put*ent functions against data injection [BZ #18724]
- Authentication-results: sourceware.org; auth=none
- References: <55B64BE2 dot 9060905 at redhat dot com> <20150728031924 dot GB21252 at vapier> <55B775E7 dot 30507 at redhat dot com> <20150728155037 dot GG21252 at vapier>
Mike Frysinger <vapier@gentoo.org> writes:
> 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
FWIW, ++errors is doing TRT for bool (equivalent to errors = true).
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."