opnsense-src/lib/libutil
Kyle Evans f3c488fc6b libutil: avoid an out-of-bounds read in trimdomain(3)
memchr(3) will happily believe we've passed in a valid object, but
hostsize could easily exceed the bounds of fullhost.  Clamp it down to
the string size to be safe and avoid UB.  This plugs a potential
overread noted in the compat shim that was just added.

Reviewed by:	des
Sponsored by:	Klara, Inc.

(cherry picked from commit f268f95955f5f0f91f4d39e13bcd69a24e0d8ce4)
2026-04-23 08:48:43 -05:00
..
tests libutil: avoid an out-of-bounds read in trimdomain(3) 2026-04-23 08:48:43 -05:00
_secure_path.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
_secure_path.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
cpuset.3 libutil: Move cpuset(1) domain policy parsing code into libutil 2025-07-27 18:31:48 +02:00
cpuset.c libutil: Move cpuset(1) domain policy parsing code into libutil 2025-07-27 18:31:48 +02:00
expand_number.3 libutil: Backward compatibility for expand_number() 2025-08-06 22:43:13 +02:00
expand_number.c libutil: Backward compatibility for expand_number() 2025-08-06 22:43:13 +02:00
flopen.3 Remove my middle name. 2023-08-17 15:08:30 +02:00
flopen.c Remove my middle name. 2023-08-17 15:08:30 +02:00
fparseln.3 fparseln: Update license 2024-06-15 18:30:27 -05:00
fparseln.c fparseln: Update license 2024-06-15 18:30:27 -05:00
ftime.3 ftime.3: fix typo in spelling of libutil 2024-10-18 15:50:24 +03:00
ftime.c libutil: move ftime to libutil 2024-05-29 14:36:09 +02:00
getlocalbase.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
getlocalbase.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
gr_util.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
hexdump.3 hexdump.3: Add missing LIBRARY section 2024-11-21 20:23:16 +00:00
hexdump.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
humanize_number.3 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
humanize_number.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kinfo_getallproc.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getallproc.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kinfo_getfile.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getfile.c kinfo_getfile: Add a comment explaining 4/3 ratio 2025-04-11 14:42:44 -04:00
kinfo_getproc.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getproc.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kinfo_getvmmap.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getvmmap.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
kinfo_getvmobject.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
kinfo_getvmobject.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
kld.3 Remove my middle name. 2023-08-17 15:08:30 +02:00
kld.c Remove my middle name. 2023-08-17 15:08:30 +02:00
libutil.h libutil: take a size_t in trimdomain() 2026-04-23 08:48:43 -05:00
login.conf.5 Remove ftpd(8) 2025-10-01 11:28:40 +01:00
login_auth.3 libutil: Fix manlint failures 2025-08-12 14:55:01 +02:00
login_auth.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
login_cap.3 libutil: Fix manlint failures 2025-08-12 14:55:01 +02:00
login_cap.c New login_getcapenum(): Allows to read named enum values 2024-01-29 22:58:05 +01:00
login_cap.h login_cap.h: Remove LOGIN_DEFPRI 2024-01-29 22:58:10 +01:00
login_class.3 libutil: support RLIMIT_PIPEBUF 2024-09-20 09:46:06 +03:00
login_class.c libutil: defer setting the MAC label until after the login class 2026-01-19 22:04:17 -06:00
login_crypt.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
login_ok.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_ok.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
login_times.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_times.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
login_tty.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
login_tty.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
Makefile packages: Install development manpages in the -dev package 2025-10-30 12:34:29 +00:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
mntopts.3 libutil: Fix manlint failures 2025-08-12 14:55:01 +02:00
mntopts.c Fix getmntpoint(3) to operate as it is documented in its manual page. 2025-11-17 15:57:26 -08:00
mntopts.h Move mntopts(3) suppport into libutil 2025-04-22 22:51:42 +01:00
pidfile.3 libutil: Document pidfile_signal() 2025-08-03 19:31:20 +02:00
pidfile.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
property.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
property.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
pty.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
pty.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
pw_util.3 libutil: Add missing MLINKs 2025-08-03 19:31:28 +02:00
pw_util.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
quotafile.3 Remove my middle name. 2023-08-17 15:08:30 +02:00
quotafile.c Remove my middle name. 2023-08-17 15:08:30 +02:00
realhostname.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
realhostname.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
realhostname_sa.3 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
stub.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
Symbol.map libutil: take a size_t in trimdomain() 2026-04-23 08:48:43 -05:00
trimdomain.3 libutil: take a size_t in trimdomain() 2026-04-23 08:48:43 -05:00
trimdomain.c libutil: avoid an out-of-bounds read in trimdomain(3) 2026-04-23 08:48:43 -05:00
uucplock.3 libutil: Fix manlint failures 2025-08-12 14:55:01 +02:00
uucplock.c lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00