Skip to content

Commit

Permalink
Hardened the checking of directory offset requested by a readdir
Browse files Browse the repository at this point in the history
When asked for the next directory entries, make sure the chunk offset
is within valid values, otherwise return no more entries in chunk.
  • Loading branch information
jpandre committed May 10, 2022
1 parent 7f81935 commit fb28eef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libfuse-lite/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2223,7 +2223,7 @@ static void fuse_lib_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
}
}
if (dh->filled) {
if (off < dh->len) {
if ((off >= 0) && (off < dh->len)) {
if (off + size > dh->len)
size = dh->len - off;
} else
Expand Down

0 comments on commit fb28eef

Please sign in to comment.