summaryrefslogtreecommitdiff
path: root/libdm
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2022-12-20 13:58:31 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2022-12-20 15:04:36 +0100
commitf443d16fd7409b46b77be2aa74090ab558c51425 (patch)
tree3350f676c6d0d3b049acff33cf3677e59278ada9 /libdm
parent44a2f2df9281ac0f5aef67d5f3c32fc2ee6ad0e9 (diff)
downloadlvm2-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.c2
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;