mirror of
https://github.com/opnsense/src.git
synced 2026-06-05 06:42:56 -04:00
Fix "singleton" function used by regcomp() to turn character set matches
into exact character matches if a character set has exactly one
element.
The underlying cset representation is complex; most critically it
records"small" characters (codepoint less than either 128
or 256 depending on locale) in a bit vector, and "wide" characters in
a secondary array.
Unfortunately the "singleton" function uses to identify singleton sets
treated a cset as a singleton if either the "small" or the "wide" sets
had exactly one element (it would then ignore the other set).
The easiest way to demonstrate this bug:
$ export LANG=C.UTF-8
$ echo 'a' | grep '[abà]'
It should match (and print "a") but instead it doesn't match because the
single accented character in the set is misinterpreted as a singleton.
PR: 281710
Reviewed by: kevans, yuripv
Obtained from: illumos
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| grot | ||
| cname.h | ||
| COPYRIGHT | ||
| engine.c | ||
| Makefile.inc | ||
| re_format.7 | ||
| regcomp.c | ||
| regerror.c | ||
| regex.3 | ||
| regex2.h | ||
| regexec.c | ||
| regfree.c | ||
| Symbol.map | ||
| utils.h | ||
| WHATSNEW | ||