freebsd_amp_hwpstate/contrib
Kyle Evans 2f489a509e libc: fix some overflow scenarios in vis(3)
The previous incarnation of this would call wcrtomb() on the destination
buffer, and only check for overflow *after* it's happened.
Additionally, the conversion error / VIS_NOLOCALE path also didn't check
for overflow, and the overflow check at the end didn't account for the
fact that we still need to write a NUL terminator afterward.

Start by only doing the multibyte conversion into mbdst directly if we
have enough buffer space to guarantee it'll fit.  An additional
MB_CUR_MAX buffer has been stashed on the stack to write into if we're
cutting it close at the end of the buffer, since we don't really have a
good way to determine the length of the wchar_t without just doing the
conversion.  We'll do the conversion into the buffer that's guaranteed
to fit, then copy it over if the copy won't overflow.

The byte-for-byte overflow is a little bit easier, as we simply check
for overflow with each byte written and make sure we can still NUL
terminate after.

Tests added to exercise these edge cases.

Reviewed by:	des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D41328
2023-08-08 12:01:52 -05:00
..
arm-optimized-routines Update the Arm Optimized Routine library to v23.01 2023-06-09 17:56:02 +01:00
atf
bc contrib/bc: upgrade to version 6.6.0 2023-05-25 17:55:31 +02:00
bearssl Merge commit 'd84e570b54961e8874bbd8de25635eb96be0977e' 2023-02-20 22:13:27 -08:00
bionic-x86_64-string Import bionic's x86_64 optimized string routines 2022-08-16 13:27:11 -04:00
blacklist blacklistd: diff reduction against upstream 2023-01-23 11:22:10 -05:00
bmake Merge bmake-20230622 2023-06-27 13:57:58 -07:00
bsddialog contrib/bsddialog: Import version 0.4 2022-09-25 15:09:16 +02:00
bsnmp bsnmp: make single bit bitfields unsigned to avoid clang 16 warning 2023-04-17 18:26:03 +02:00
byacc byacc: Adjust expected test output to match our patches. 2023-02-22 20:05:02 +01:00
bzip2
capsicum-test Update capsicum-test to eab7a83b05becf64439b4b256b3d756b353fbbbb 2022-09-13 13:42:46 -04:00
com_err
cortex-strings
dialog
diff gnu diff3: apply patch to committed src, rather than at build time 2022-11-13 21:33:40 -05:00
dma dma: use OpenSSL 1.1 init API 2023-05-11 19:03:34 -04:00
ee ee: Remove two set but unused variables. 2023-04-18 12:53:32 -07:00
elftoolchain readelf: fix -wR option, memory leaks, and -wf minor bug 2023-03-06 12:51:23 -05:00
expat MFV: expat 2.5.0 2022-11-17 22:15:00 -08:00
file MFV: Restore the ability to process files from stdin immediately. 2022-10-27 00:12:53 -07:00
flex
gdtoa
googletest
hyperv/tools hyperv/kvp: Remove set but unused variables. 2023-06-27 10:19:32 -07:00
jemalloc jemalloc: Define SWAP_RESERVE_* if not provided by the system headers 2022-09-17 01:35:35 +03:00
kyua
ldns ldns: Remove a set but unused variable. 2023-06-27 10:19:32 -07:00
ldns-host
less MFV: less v632. 2023-05-01 20:43:57 -07:00
lib9p lib9p: Remove set but unused sockets[] array from l9p_start_server. 2023-06-20 09:28:59 -07:00
libarchive libarchive: merge from vendor branch 2023-08-04 01:04:14 +02:00
libbegemot
libc-pwcache
libc-vis libc: fix some overflow scenarios in vis(3) 2023-08-08 12:01:52 -05:00
libcbor libcbor: update to 0.10.2 2023-04-21 16:10:03 -04:00
libcxxrt Merge libcxxrt commit 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd 2022-08-08 12:50:48 -04:00
libdivsufsort
libedit libedit: update to snapshot 2023-01-06 2023-02-06 14:25:06 +01:00
libevent
libexecinfo
libfido2 libfido2: update to 1.10.0 2023-05-05 19:57:34 -04:00
libpcap libpcap: Update to 1.10.4 2023-05-05 10:56:10 -03:00
libucl
libxo Merge commit '7087c8de43b0d5d27c52da6ba2ba4957b7e336ff' into new_merge 2023-01-30 00:04:21 -05:00
llvm-project arm64 lib32: change clang to allow -m32 on arm64 2023-07-25 18:58:51 -05:00
lua Merge LUA 5.4.6 2023-07-15 11:31:04 -06:00
lutok
mandoc mandoc: workaround lack of macro parsing in list -width 2022-05-31 10:06:46 -05:00
mknod
mtree
ncurses
netbsd-tests libc: fix some overflow scenarios in vis(3) 2023-08-08 12:01:52 -05:00
netcat netcat: Allow nc to be an if_tun tunnel broker 2023-01-17 10:05:49 +00:00
ntp ntp: Fix build 2023-06-06 06:27:05 -07:00
nvi
ofed opensm libopensm: remove non-existent symbols from the version map 2023-08-04 02:13:14 +03:00
one-true-awk awk: errror on printf format strings lacking conversion specifier 2023-04-14 13:31:02 -04:00
openbsm auditdistd: Avoid calling deprecated OpenSSL functions 2023-05-26 09:15:25 -04:00
opencsd/decoder Import OpenCSD v.1.4.0. 2023-03-27 17:03:16 +01:00
openpam openpam: Migrate from COMPAT_32BIT to generic COMPAT_libcompat 2023-07-09 18:48:17 +01:00
openresolv
pam_modules/pam_passwdqc
pf pf/libevent: Consistently pass evsignal to sigaction. 2023-06-20 12:31:19 -07:00
pjdfstest
pnglite
pnpinfo pnpinfo: Use C89 function definitions. 2023-04-18 11:31:13 -07:00
processor-trace
sendmail Note upgrade to sendmail 8.17.1 2023-02-01 02:22:39 +00:00
smbfs smbfs: Use C89 function definition for cf_getopt. 2023-04-18 11:20:43 -07:00
spleen contrib/spleen: update to Spleen 2.0.0 2023-06-08 10:42:25 -04:00
sqlite3 sqlite3: Vendor import of sqlite3 3.42.0 2023-05-28 07:31:36 -07:00
tcp_wrappers tcp_wrappers: recognize IPv6 addresses/prefixes 2023-07-20 14:56:20 -07:00
tcpdump tcpdump: Reconnect pfsync printer 2023-06-17 07:05:58 -03:00
tcsh
telnet telnet: Use C89 function definitions for two stragglers. 2023-04-18 11:27:47 -07:00
terminus contrib/terminus: update to terminus-font-4.49.1 2022-02-02 15:42:18 +02:00
tnftp
traceroute traceroute: Remove set but unused variable. 2023-06-20 09:28:59 -07:00
tzcode Update tzcode to 2023c. 2023-04-26 11:46:21 +02:00
tzdata contrib/tzdata: import tzdata 2023c 2023-03-29 09:09:54 +08:00
unbound unbound: Vendor import 1.17.1 2023-01-14 21:39:31 -08:00
unvis
vis
wireguard-tools Merge commit '93bf91b4012a28610672d2266366dfa0a663b70f' into HEAD 2022-11-04 22:46:21 -05:00
wpa wpa: Enable receiving priority tagged (VID 0) frames 2023-06-11 16:26:04 -07:00
xz MFV: xz 5.4.4. 2023-08-03 00:52:36 -07:00