Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion fs/hfs/bnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ u32 check_and_correct_requested_length(struct hfs_bnode *node, u32 off, u32 len)

node_size = node->tree->node_size;

if ((off + len) > node_size) {
if ((u64)off + len > node_size) {
u32 new_len = node_size - off;

pr_err("requested length has been corrected: "
Expand All @@ -64,6 +64,8 @@ void hfs_bnode_read(struct hfs_bnode *node, void *buf, u32 off, u32 len)
u32 bytes_read;
u32 bytes_to_read;

memset(buf, 0, len);

if (!is_bnode_offset_valid(node, off))
return;

Expand Down
2 changes: 2 additions & 0 deletions fs/hfsplus/bnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ void hfs_bnode_read(struct hfs_bnode *node, void *buf, u32 off, u32 len)
struct page **pagep;
u32 l;

memset(buf, 0, len);

if (!is_bnode_offset_valid(node, off))
return;

Expand Down
2 changes: 1 addition & 1 deletion fs/hfsplus/hfsplus_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ u32 check_and_correct_requested_length(struct hfs_bnode *node, u32 off, u32 len)

node_size = node->tree->node_size;

if ((off + len) > node_size) {
if ((u64)off + len > node_size) {
u32 new_len = node_size - off;

pr_err("requested length has been corrected: "
Expand Down
Loading