diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2022-12-20 13:58:31 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2022-12-20 15:04:36 +0100 |
commit | f443d16fd7409b46b77be2aa74090ab558c51425 (patch) | |
tree | 3350f676c6d0d3b049acff33cf3677e59278ada9 /libdm | |
parent | 44a2f2df9281ac0f5aef67d5f3c32fc2ee6ad0e9 (diff) | |
download | lvm2-f443d16fd7409b46b77be2aa74090ab558c51425.tar.gz |
cov: fix buffer size usage
Count with extra 1 byte for buffer end '\0'.
Diffstat (limited to 'libdm')
-rw-r--r-- | libdm/dm-tools/dmfilemapd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libdm/dm-tools/dmfilemapd.c b/libdm/dm-tools/dmfilemapd.c index d547e59d5..f6c04e03e 100644 --- a/libdm/dm-tools/dmfilemapd.c +++ b/libdm/dm-tools/dmfilemapd.c @@ -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; |