Skip to content

Commit

Permalink
libhfs: fix potential truncation of large contiguous extents
Browse files Browse the repository at this point in the history
Individual extents greater than 4gb are possible at least in theory, in
which case hfslib_readd_with_extents would have only read partial data.
  • Loading branch information
0x09 committed May 27, 2024
1 parent 4cfb690 commit 3a5caf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libhfs/libhfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2793,7 +2793,7 @@ hfslib_readd_with_extents(
if (in_extents[i].block_count == 0)
continue;

ext_length = in_extents[i].block_count * in_vol->vh.block_size;
ext_length = (uint64_t)in_extents[i].block_count * in_vol->vh.block_size;

if (last_offset + ext_length < last_offset)
break;
Expand Down

0 comments on commit 3a5caf2

Please sign in to comment.