[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug#624387: [bug #33198] Incorrect bracket expression when parsing i
From: |
Jim Meyering |
Subject: |
Re: Bug#624387: [bug #33198] Incorrect bracket expression when parsing in ru_RU.KOI8-R (Russian locale) |
Date: |
Sun, 05 Jun 2011 19:29:25 +0200 |
Paolo Bonzini wrote:
> 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.
You must not have seen the guards I added in the comments just
preceding yours, e.g.,
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=624387#129
[PATCH] dfa: fix case folding logic for character ranges, Paolo Bonzini, 2011/06/07
Re: [bug #33198] Incorrect bracket expression when parsing in ru_RU.KOI8-R (Russian locale), Jim Meyering, 2011/06/02
[bug #33198] Incorrect bracket expression when parsing in ru_RU.KOI8-R (Russian locale), Jim Meyering, 2011/06/19