opnsense-src/lib/libc
Jessica Clarke 5d10ed57e6 libc: Fix "harmless" iconv one-byte overread
Checking there are still bytes left must be done before dereferencing
the pointer, not the other way round. This is harmless on traditional
architectures since the result will immediately be thrown away, and all
callers are in separate translation units so there is no potential for
optimising based on this out-of-bounds read. However, on CHERI, pointers
are bounded, and so this will trap if fed a string that does not have a
NUL within the first len bytes.

Found by:	CHERI
Reviewed by:	brooks

(cherry picked from commit 6d5297569e)
2022-01-24 23:59:47 +00:00
..
aarch64 Add sched_getcpu() 2022-01-14 18:17:29 +02:00
amd64 libc: add _get_tp() private function 2021-04-23 14:14:07 +03:00
arm Add sched_getcpu() 2022-01-14 18:17:29 +02:00
capability Fix a few mandoc issues 2020-10-09 19:12:44 +00:00
compat-43 Adjust history, info source from v1's manuals 2019-09-04 13:44:46 +00:00
db tools/build: Don't redefine open() for the linux bootstrap 2021-08-05 10:00:45 +01:00
gdtoa Remove sparc64 specific parts of libc. 2020-02-26 18:55:09 +00:00
gen sched_get/setaffinity(): try to be more compatible with Linux 2022-01-14 18:17:31 +02:00
gmon mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
i386 libc: add _get_tp() private function 2021-04-23 14:14:07 +03:00
iconv libc: Fix "harmless" iconv one-byte overread 2022-01-24 23:59:47 +00:00
include Add sched_getcpu() 2022-01-14 18:17:29 +02:00
inet libc: fix cases of undefined behavior. 2018-08-07 15:24:19 +00:00
isc SPDX: more ISC-related files. 2017-12-08 17:52:53 +00:00
locale Revert "libc/locale: Fix races between localeconv(3) and setlocale(3)" 2021-10-19 21:13:12 -04:00
md Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
mips Add sched_getcpu() 2022-01-14 18:17:29 +02:00
nameser Bounds check again after advancing cp, otherwise we have a possible 2019-09-05 19:35:30 +00:00
net libc: Fix build with -DNS_REREAD_CONF. 2021-12-31 19:26:43 -05:00
nls Implement strerror_l(). 2020-12-16 09:02:09 +00:00
posix1e acl_delete_entry(): remove write-only variable 2021-12-06 02:23:45 +02:00
powerpc Add sched_getcpu() 2022-01-14 18:17:29 +02:00
powerpc64 Add sched_getcpu() 2022-01-14 18:17:29 +02:00
powerpcspe [PowerPC] [PowerPCSPE] Fix multiple issues in fpsetmask(). 2021-03-08 12:39:33 -06:00
quad Add casts and L suffixes to libc quad support, to work around various 2020-02-17 20:14:59 +00:00
regex libc: regex: rework unsafe pointer arithmetic 2021-01-08 13:58:35 -06:00
resolv res_init: remove unused inet_makeaddr with IN_LOOPBACKNET 2021-12-10 10:26:14 -06:00
riscv Add sched_getcpu() 2022-01-14 18:17:29 +02:00
rpc libc clnt_com_create: relock rpcsoc_lock earlier when port is obtained from portmapper 2022-01-15 02:51:13 +02:00
secure libc: ssp: sprinkle around some __dead2 2021-10-06 02:14:42 -05:00
softfloat Add implementations for clog(3), clogf(3), and clog(3). 2018-05-13 09:54:34 +00:00
stdio libc/stdio/vfwscanf.c::convert_wstring(): wcp0 is write-only 2021-12-06 02:23:45 +02:00
stdlib Fix null pointer subtraction in mergesort() 2021-08-31 21:05:43 +02:00
stdtime strptime: make %k and %l specifiers match their description in 2018-11-03 23:37:13 +00:00
string libc: correct SPDX tag on strstr.c 2022-01-18 19:32:29 -05:00
sys kqueue(2): Add note about format of the data for NOTE_EXIT 2022-01-22 02:50:23 +02:00
tests libc/tests/stdlib/dynthr_mod/dynthr_mod.c: mark dummy as used 2021-12-06 02:23:45 +02:00
uuid uuid(3): Document return values 2021-11-21 19:43:31 -05:00
x86 Make CPU_SET macros compliant with other implementations 2022-01-14 18:17:30 +02:00
xdr typo: s/impelmentation/implementation/. 2020-02-07 15:14:29 +00:00
yp Increase the size of the send and receive buffers for YP client rpc 2019-09-16 06:42:01 +00:00
libc.ldscript Attempt to move the POSIX iconv* symbols out of runtime linker space. 2013-11-17 22:52:17 +00:00
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
Makefile libc: Use the initial-exec TLS model 2021-09-14 08:50:53 -04:00
Makefile.depend Update Makefile.depend files 2019-12-11 17:37:53 +00:00
Makefile.depend.options Update libssp paths in various Makefile.depend* files 2020-01-06 18:15:55 +00:00
Versions.def Create namespace for the symbols added during 14-CURRENT cycle. 2021-07-22 13:33:10 +03:00