opnsense-src/lib/libc/amd64/string
Robert Clausecker b2618b651b lib/libc/amd64/string/memchr.S: fix behaviour with overly long buffers
When memchr(buf, c, len) is called with a phony len (say, SIZE_MAX),
buf + len overflows and we have buf + len < buf.  This confuses the
implementation and makes it return incorrect results.  Neverthless we
must support this case as memchr() is guaranteed to work even with
phony buffer lengths, as long as a match is found before the buffer
actually ends.

Sponsored by:	The FreeBSD Foundation
Reported by:	yuri, des
Tested by:	des
Approved by:	mjg (blanket, via IRC)
MFC after:	1 week
MFC to:		stable/14
PR:		273652
2023-09-10 08:52:59 -04:00
..
amd64_archlevel.c lib/libc/amd64: add archlevel-based simd dispatch framework 2023-08-04 01:53:43 +03:00
bcmp.S amd64: bring back asm bcmp, shared with memcmp 2022-03-26 09:10:03 +00:00
bcopy.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
bzero.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
Makefile.inc lib/libc/amd64/string: implement strnlen(3) trough memchr(3) 2023-09-08 17:22:31 -04:00
memchr.S lib/libc/amd64/string/memchr.S: fix behaviour with overly long buffers 2023-09-10 08:52:59 -04:00
memcmp.S lib/libc/amd64/string/memcmp.S: add baseline implementation 2023-08-21 21:19:46 +02:00
memcpy.S Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
memmove.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
memset.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
stpcpy.S lib/libc/amd64/string/stpcpy.S: add baseline implementation 2023-08-21 20:59:38 +02:00
strcat.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
strchrnul.S lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code 2023-08-25 21:21:54 +02:00
strcmp.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
strcpy.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
strcspn.S lib/libc/amd64/string: add strcspn(3) scalar, x86-64-v2 implementation 2023-09-08 17:20:19 -04:00
strlen.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
strnlen.c lib/libc/amd64/string: implement strnlen(3) trough memchr(3) 2023-09-08 17:22:31 -04:00
strspn.S lib/libc/amd64/string: add strspn(3) scalar, x86-64-v2 implementation 2023-09-08 17:21:59 -04:00