]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
kill: fix buffer overflow
authorKarel Zak <kzak@redhat.com>
Tue, 28 Feb 2023 12:11:05 +0000 (13:11 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Feb 2023 12:11:05 +0000 (13:11 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/procfs.c

index 20fa514a0cb359b27c36a5256dc19409048db76c..e9cf17a47c7b861f6615bdfad07d4b70dfeb38ac 100644 (file)
@@ -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);