bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#624387: [bug #33198] Incorrect bracket expression when parsing i


From: Paolo Bonzini
Subject: Re: Bug#624387: [bug #33198] Incorrect bracket expression when parsing in ru_RU.KOI8-R (Russian locale)
Date: Sun, 5 Jun 2011 19:04:46 +0200

On Sat, Jun 4, 2011 at 09:48, Jim Meyering <address@hidden> wrote:
>> The b2 == EOF part is required for the somewhat similar bug I fixed
>> a month ago:
>>
>>     fix a bug whereby echo c|grep '[c]' would fail for any c in 0x80..0xff
>>     8da41c930e03a8635cbd8c89e3e591374c232c89
>>
>> The corresponding test demonstrates the need:
>>
>>     tests: exercise bug with 0x80..0xff in [...]
>>     d98338ebf842ec9b69631837eee50ebdcd543505

[\xff] is not well defined for a UTF-8 locale at all, actually.
Perhaps FETCH_WC should return wc = EOF in this case (and c = 255),
and it could be handled on a case-by-case basis elsewhere.

But if wctob returns EOF, and b > UCHAR_MAX, you have introduced an
out-of-bounds access in setbit.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]