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

dmfilemapd: keep 1 byte for \0

Coverity noticed the buffer should have 1 byte for \0.
This commit is contained in:
Zdenek Kabelac 2017-04-01 12:05:49 +02:00
parent 6c342abb7f
commit dfc083d8d6

View File

@ -589,7 +589,7 @@ check_unlinked:
log_error("Could not format pid path.");
return 0;
}
if ((len = readlink(path_buf, link_buf, sizeof(link_buf))) < 0) {
if ((len = readlink(path_buf, link_buf, sizeof(link_buf) - 1)) < 0) {
log_error("readlink failed for " DEFAULT_PROC_DIR "/%d/fd/%d.",
getpid(), fm->fd);
return 0;