[PATCH] regcomp: Fix off-by-one bug in build_equiv_class [BZ #23396]

Florian Weimer fweimer@redhat.com
Tue Jul 24 14:35:00 GMT 2018


On 07/13/2018 08:30 PM, Carlos O'Donell wrote:
> On 07/13/2018 11:35 AM, Florian Weimer wrote:
>> This bug is very similar to bug 23036: The existing code assumed that
>> the length count included the length byte itself.
>>
>> 2018-07-13  Florian Weimer<fweimer@redhat.com>
>>
>> 	[BZ #23396]
>> 	* posix/regcomp.c (build_equiv_class): When comparing weights, do
>> 	not compare an extra byte after the end of the weights.
> There is another loop similar to this in fnmatch_loop.c, could you please
> have a look at that one too. It appears to be correct, you pointed out to
> me that it does 'cnt == len', but it would be good to have a definitive
> answer there.

I enhanced my enumeration tester to cover fnmatch too, and it produces 
the expected result for [[=a=]] (matching the fixed regex result), 
without further changes.

Thanks,
Florian



More information about the Libc-alpha mailing list