From 744daf0d3d72e71854f8248dbf2bc0b81fe110ec Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 9 Jul 2019 20:00:00 +0200 Subject: Make coverity happy The string is actually always null-terminated, since the calloc above adds one more byte than what we tell readlink about. Signed-off-by: David Oberhollenzer --- lib/fstree/fstree_from_dir.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/fstree/fstree_from_dir.c b/lib/fstree/fstree_from_dir.c index ff9f078..29911f4 100644 --- a/lib/fstree/fstree_from_dir.c +++ b/lib/fstree/fstree_from_dir.c @@ -84,6 +84,8 @@ static int populate_dir(fstree_t *fs, tree_node_t *root) if (readlink(ent->d_name, extra, sb.st_size) < 0) goto fail_rdlink; + + extra[sb.st_size] = '\0'; } else if (S_ISREG(sb.st_mode)) { extra = get_file_path(root, ent->d_name); if (extra == NULL) -- cgit v1.2.3