procps/library
Jim Warner 49f92f690c library: refactor the escape_str utf-8 validation code
The last time library 'escape' logic was refactored in
the patch referenced below potential problems remained
which have now surfaced. They involve those C1 control
characters especially device control strings (DCS/ST).

Such strings, if not handled by the terminal emulator,
could lead to abnormal behaviors or even some exploit.

So, this commit will now escape the multi-byte control
characters (U+0080 thru U+009f). All single byte ascii
control characters were already treated in this manner.

[ in addition, continuation bytes in utf-8 encodings ]
[ requiring two bytes or more will also be validated ]

And unlike the current code, which will escape all the
remaining non-ascii bytes when some error is detected,
this patch honors remaining valid ascii & utf-8 bytes.

Reference(s):
. Dec, 2020 - 'escape' logic' was refactored *again)
commit 649e45482f

Signed-off-by: Jim Warner <james.warner@comcast.net>
2023-07-30 21:08:20 +10:00
..
include slabinfo: add comment for cache_size calculation 2023-04-25 07:19:22 +00:00
tests tests: Fix type for check_fatal_proc_unmounted 2022-12-06 22:23:08 +11:00
.gitignore build-sys: Relocate library to library/ 2022-08-29 19:02:44 +10:00
COPYING build-sys: Relocate library to library/ 2022-08-29 19:02:44 +10:00
devname.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00
diskstats.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00
escape.c library: refactor the escape_str utf-8 validation code 2023-07-30 21:08:20 +10:00
libproc2.pc.in misc: Update pc file to new library name 2022-08-29 20:42:45 +10:00
libproc2.sym library: Rename to libproc2 2022-08-29 20:38:17 +10:00
meminfo.c misc: tweak the recent copyright changes just a little 2023-02-14 07:11:51 +11:00
namespace.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00
numa.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00
pids.c library: improve the assign results function, pids api 2023-05-07 09:43:44 +10:00
pwcache.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00
readproc.c library: restore the proper main thread tics valuation 2023-05-31 18:25:07 +10:00
slabinfo.c slabinfo: add comment for cache_size calculation 2023-04-25 07:19:22 +00:00
stat.c vmstat: remove this process form the number of processe 2023-07-13 10:25:10 +00:00
sysinfo.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00
uptime.c library: use sd_booted() if systemd is in use 2023-05-31 16:52:41 +10:00
version.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00
vmstat.c misc: tweak the recent copyright changes just a little 2023-02-14 07:11:51 +11:00
wchan.c misc: Update the copyrights of files 2023-02-07 21:09:48 +11:00