freebsd-dev/lib/libc/regex
Yuri Pankov 547bc083d6 regcomp: reduce size of bitmap for multibyte locales
This fixes the obscure endless loop seen with case-insensitive
patterns containing characters in 128-255 range;  originally
found running GNU grep test suite.

Our regex implementation being kludgy translates the characters
in case-insensitive pattern to bracket expression containing both
cases for the character and doesn't correctly handle the case when
original character is in bitmap and the other case is not, falling
into the endless loop going through in p_bracket(), ordinary(),
and bothcases().

Reducing the bitmap to 0-127 range for multibyte locales solves this
as none of these characters have other case mapping outside of bitmap.
We are also safe in the case when the original character outside of
bitmap has other case mapping in the bitmap (there are several of those
in our current ctype maps having unidirectional mapping into bitmap).

Reviewed by:	bapt, kevans, pfg
Differential revision:	https://reviews.freebsd.org/D18302
2018-12-12 04:23:00 +00:00
..
grot Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
cname.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
COPYRIGHT
engine.c regexec: fix processing multibyte strings. 2018-11-23 15:49:18 +00:00
Makefile.inc Add libregex, connect it to the build 2018-01-22 02:44:41 +00:00
re_format.7 Remove SVR4 (System V Release 4) binary compatibility support. 2017-02-28 05:14:42 +00:00
regcomp.c regcomp: reduce size of bitmap for multibyte locales 2018-12-12 04:23:00 +00:00
regerror.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
regex2.h regcomp: reduce size of bitmap for multibyte locales 2018-12-12 04:23:00 +00:00
regex.3 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
regexec.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
regfree.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
Symbol.map
utils.h regcomp: reduce size of bitmap for multibyte locales 2018-12-12 04:23:00 +00:00
WHATSNEW