[PATCH] Fix another MBS regex failure
Andreas Jaeger
aj@suse.de
Mon May 14 02:27:00 GMT 2001
Jakub Jelinek <jakub@redhat.com> writes:
> Hi!
>
> The following testcase fails with MBS_SUPPORT enabled regex.
> There are two issues: the code is swapping strings if second string is zero
> size and first non-NULL, but we were not swapping their MBS data together
> with them (cstring* are not used any more, so it is enough to swap
> mbs_offset* and csize*). Also, if stop is past csize1 + csize2,
> count_mbs_length would return -1 and things would fail, because end_match_2
> would point before string2 (unlike non-MBS, where stop however large is
> simply added to string2 to compute end_match_2).
>
> 2001-05-11 Jakub Jelinek <jakub@redhat.com>
>
> * posix/regex.c (re_match_2_internal): Swap mbs_offset and csize
> as well if swapping strings.
> Make sure stop is not past end of second string.
> * posix/bug-regex4.c: New test.
> * posix/Makefile (tests): Add bug-regex4.
Committed,
Thanks,
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
More information about the Libc-hacker
mailing list