1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: fix buffer size usage

Count with extra 1 byte for buffer end '\0'.
This commit is contained in:
Zdenek Kabelac 2022-12-20 13:58:31 +01:00
parent 44a2f2df92
commit f443d16fd7

View File

@ -172,7 +172,7 @@ static int _is_open_in_pid(pid_t pid, const char *path)
if (pid_dp->d_name[0] == '.')
continue;
if ((len = readlinkat(dirfd(pid_d), pid_dp->d_name, link_buf,
sizeof(link_buf))) < 0) {
(sizeof(link_buf) - 1))) < 0) {
log_error("readlink failed for " DEFAULT_PROC_DIR
"/%d/fd/.", pid);
goto bad;