diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-09 20:00:00 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-10 08:51:32 +0200 |
commit | 744daf0d3d72e71854f8248dbf2bc0b81fe110ec (patch) | |
tree | 8dfe7619e528fb7f05954c9b101d05432524a0a2 /lib/fstree | |
parent | 6b875fa3abc98536ad94d186876af67f6162969d (diff) |
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree')
-rw-r--r-- | lib/fstree/fstree_from_dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) |