opnsense-src/lib/libc
Robert Clausecker 61ed5748e4 lib/libc/tests/string: improve memccpy "bounds" unit test
The purpose of the "bounds" test is to check that the function does not
overread the array bounds.  The old unit test, copied from the strlcpy()
one, always ensured that we see the character c memccpy() is looking for
in the source array before the array ends.  While this is correct for
strlcpy(), memccpy()'s specification does not guarantee that c is
present within the given size limit.

The updated test handles this case better, ensuring that the source
array ends early if c is not supposed to be present.

Reported by:	getz
Approved by:	emaste
See also:	D46052
Event:		GSoC 2024
Differential Revision:	https://reviews.freebsd.org/D46051
2024-09-14 20:42:19 +02:00
..
aarch64 libc/aarch64: Remove an unneeded weak symbol 2024-08-21 10:16:10 +00:00
amd64 lib/libc/amd64/string: fix overread condition in memccpy 2024-07-29 21:36:10 +02:00
arm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
capability Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
compat-43 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
csu libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
db Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
gdtoa Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
gen Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
gmon Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
i386 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
iconv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
include libthr: avoid gcc -Wcast-function-type 2024-07-03 08:38:32 -07:00
inet Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
isc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
locale Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
md Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nameser Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
net getaddrinfo.{1,3}: Cross-reference ip6addrctl(8) 2024-09-06 12:34:32 -06:00
nls libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
posix1e Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
powerpc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
powerpc64 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
powerpcspe Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
quad Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
regex Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
resolv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
riscv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
secure include: ssp: don't shadow the mempcpy builtin 2024-07-16 00:12:28 -05:00
softfloat libc/softfloat: we don't export _fp[gs]et* symbols 2024-03-13 20:35:41 +00:00
stdio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
stdlib jemalloc: don't expose 3.0 compat symbols 2024-08-22 17:08:24 +01:00
stdtime libc: Improve description of mktime() / timegm(). 2024-03-27 11:03:37 +01:00
string include: ssp: don't shadow the mempcpy builtin 2024-07-16 00:12:28 -05:00
sys libc: switch to __weak_symbol for fortified interpose stubs 2024-07-16 00:12:28 -05:00
tests lib/libc/tests/string: improve memccpy "bounds" unit test 2024-09-14 20:42:19 +02:00
uuid Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
x86/gen Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
xdr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
yp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06: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 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06: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