freebsd-dev/libexec
Jessica Clarke becd9908be rtld-elf: Fix leaks and wild frees in origin_subst
55abf23dd3 inverted the value passed to origin_subst_one when rolling
up the existing code into a loop. If the first token is found ($ORIGIN),
this results in a wild free of part of strtab. Processing the second
token works fine and will act how the first should have regardless of
whether found, allocating memory for the string without freeing.
Processing subsequent tokens however will then leak, regardless of
whether found, as they will also believe they need to allocate memory
and can't free the string.

Found by:	CHERI
Reviewed by:	kib, markj
Fixes:		55abf23dd3 ("rtld: make token substitution table-driven")
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35792
2022-07-12 17:47:47 +01:00
..
atf testing: provide meaningful error when pytest is not available 2022-07-06 19:55:58 +00:00
atrun libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
blacklistd-helper
bootpd bootp: remove the USE_BFUNCS knob 2021-09-30 23:47:06 -05:00
comsat General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
dma dma: make the version exposed reflect the new version 2021-09-22 11:12:04 +02:00
fingerd Update Makefile.depend files 2019-12-11 17:37:53 +00:00
flua stand: lua: enhance lfs.dir() to speed up kernels_autodetect 2021-01-29 12:47:29 -06:00
ftpd ftp: Use /var/spool/ftp as ftp's home consistently 2022-06-28 15:20:05 +02:00
getty pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
hyperv pkgbase: Create a FreeBSD-hyperv package 2021-09-07 10:24:54 +02:00
mail.local DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
makewhatis.local makewhatis: do not try to operate on read-only mounted directories 2018-10-27 17:15:58 +00:00
mknetid General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
phttpget phttpget: move out of portsnap 2020-09-09 00:39:47 +00:00
pppoed libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rbootd Fix the following -Werror warning from clang 10.0.0 in rbootd: 2020-01-28 19:19:55 +00:00
rc rc.subr: Fix a typo 2022-07-08 21:35:34 +02:00
revnetgroup General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
rpc.rquotad pkgbase: Create a FreeBSD-nfs package 2021-06-19 17:49:50 +02:00
rpc.rstatd General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
rpc.rusersd General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
rpc.rwalld libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
rpc.sprayd rpc.sprayd: raise WARNS to 6 2018-03-05 16:11:07 +00:00
rtld-elf rtld-elf: Fix leaks and wild frees in origin_subst 2022-07-12 17:47:47 +01:00
rtld-elf32 libcompat: Correct rtld MLINKS 2019-11-12 22:31:59 +00:00
save-entropy Reduce disk write load in /usr/libexec/save-entropy. 2019-11-30 20:06:53 +00:00
smrsh DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
talkd Regularize my copyright notice 2019-12-04 16:56:11 +00:00
tcpd pkgbase: Create a FreeBSD-tcpd package 2021-12-21 10:17:31 +01:00
telnetd ncurses: chase dependency changes in the source tree 2021-10-04 11:38:24 +02:00
tests
tftp-proxy (t)ftp-proxy: use libpfctl 2021-04-10 11:16:02 +02:00
tftpd When receiving a file having a length, which is a mulitple of the blocksize, 2020-12-15 09:43:18 +00:00
ulog-helper libexec: adoption of SPDX licensing ID tags. 2017-11-27 15:25:02 +00:00
ypxfr pkgbase: Put yellow pages programs to its own package 2021-12-21 10:17:22 +01:00
Makefile phttpget: move out of portsnap 2020-09-09 00:39:47 +00:00
Makefile.amd64
Makefile.i386
Makefile.inc Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00