From: Karel Zak Date: Tue, 28 Feb 2023 12:11:05 +0000 (+0100) Subject: kill: fix buffer overflow X-Git-Tag: v2.39-rc1~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8493779e7e92240a3e60a2110524e72793061b3;p=thirdparty%2Futil-linux.git kill: fix buffer overflow Signed-off-by: Karel Zak --- diff --git a/lib/procfs.c b/lib/procfs.c index 20fa514a0c..e9cf17a47c 100644 --- a/lib/procfs.c +++ b/lib/procfs.c @@ -369,7 +369,7 @@ int procfs_dirent_get_name(DIR *procfs, struct dirent *d, char *buf, size_t bufs end++; sz = end - p; - if (sz > bufsz) + if (sz >= bufsz) sz = bufsz - 1; memcpy(buf, p, sz);