Skip to content

Commit

Permalink
Merge pull request #247 from cgwalters/readlinkat-overflow
Browse files Browse the repository at this point in the history
writer: Fix (almost certainly unreachable) overflow
  • Loading branch information
alexlarsson authored Feb 5, 2024
2 parents 232336d + 6b2192b commit 091b51f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcomposefs/lcfs-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ struct lcfs_node_s *lcfs_load_node_from_file(int dirfd, const char *fname,
} else if ((sb.st_mode & S_IFMT) == S_IFLNK) {
char target[PATH_MAX + 1];

r = readlinkat(dirfd, fname, target, sizeof(target));
r = readlinkat(dirfd, fname, target, sizeof(target) - 1);
if (r < 0)
return NULL;

Expand Down

0 comments on commit 091b51f

Please sign in to comment.