opnsense-src/lib/libc
Bill Sommerfeld 8f7ed58a15 regex: mixed sets are misidentified as singletons
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.

Reviewed by:	kevans, yuripv
Obtained from:	illumos
Differential Revision:	https://reviews.freebsd.org/D43149
2023-12-22 12:19:59 +07:00
..
aarch64 libc/*/SYS.h: remove SYCALL macro 2023-12-12 22:52:41 +00:00
amd64 lib/libc/amd64/string/strcspn.S: always return earliest match in 17--32 char case 2023-12-21 03:17:17 +01:00
arm arm/SYS.h: align with other arches 2023-12-18 22:28:42 +00:00
capability capsicum: introduce cap_rights_is_empty Function 2023-12-11 12:15:46 +01:00
compat-43 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
csu libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
db lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
gdtoa libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
gen libc: expose execvpe for Linux compat 2023-12-11 19:24:53 +00:00
gmon lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
i386 {amd64,i386}/SYS.h: add _SYSCALL and _SYSCALL_BODY 2023-12-18 22:28:42 +00:00
iconv libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
include libc: expose execvpe for Linux compat 2023-12-11 19:24:53 +00:00
inet lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
isc lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
locale lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
md Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
nameser lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
net lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
nls libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
posix1e libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(3) 2023-12-18 00:06:03 +02:00
powerpc Revert "power*/SYS.h: implement _SYSCALL_BODY() macro" 2023-12-21 21:37:09 +00:00
powerpc64 Revert "power*/SYS.h: implement _SYSCALL_BODY() macro" 2023-12-21 21:37:09 +00:00
powerpcspe libc/<arch>/sys/Makefile.inc: remove cruft 2023-11-15 17:50:53 +00:00
quad Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
regex regex: mixed sets are misidentified as singletons 2023-12-22 12:19:59 +07:00
resolv lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
riscv riscv/SYS.h: implement _SYSCALL_BODY() macro 2023-12-18 22:28:42 +00:00
rpc lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
secure libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
softfloat libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
stdio lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
stdlib strfmon.c: Use the restrict keyword directly 2023-12-10 23:28:25 +02:00
stdtime Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
string lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
sys Remove _POSIX_PRIORITIZED_IO references from man pages 2023-12-18 08:06:55 -07:00
tests regex: mixed sets are misidentified as singletons 2023-12-22 12:19:59 +07:00
uuid libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
x86 libc/<arch>/sys/Makefile.inc: remove cruft 2023-11-15 17:50:53 +00:00
xdr lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
yp lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libc.ldscript Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
libc_nossp.ldscript Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
Makefile lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
Makefile.depend dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
Makefile.depend.options Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Versions.def Create namespace for the symbols added during 15-CURRENT cycle 2023-09-22 10:16:29 +02:00