From dfc083d8d66cf3286908e9c7fc0c53bd1e5d4967 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 1 Apr 2017 12:05:49 +0200 Subject: [PATCH] dmfilemapd: keep 1 byte for \0 Coverity noticed the buffer should have 1 byte for \0. --- daemons/dmfilemapd/dmfilemapd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemons/dmfilemapd/dmfilemapd.c b/daemons/dmfilemapd/dmfilemapd.c index 88f8af2ef..d232a838a 100644 --- a/daemons/dmfilemapd/dmfilemapd.c +++ b/daemons/dmfilemapd/dmfilemapd.c @@ -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;