Skip to content

Commit

Permalink
mkcomposefs: Fix possibly garbage return in error path
Browse files Browse the repository at this point in the history
Found by clang-analyzer.

(At this point, I have to say: I don't understand why in 2021 we
 created a new project in the C programming language...)

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Aug 25, 2023
1 parent 4b35a7a commit 9e46d05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int fill_payload(struct lcfs_node_s *node, const char *path, size_t len,
char target[PATH_MAX + 1];
ssize_t s = readlink(path, target, sizeof(target));
if (s < 0)
return ret;
return s;

target[s] = '\0';
ret = lcfs_node_set_payload(node, target);
Expand Down

0 comments on commit 9e46d05

Please sign in to comment.