Skip to content

Commit

Permalink
hfsfuse: fix short reads for compressed files
Browse files Browse the repository at this point in the history
The file's logical size is used to sanity check the read values
requested by FUSE, so for compressed files should reflect their
decompressed size rather than the size of the data fork's (which for
these is zero.)
  • Loading branch information
0x09 committed Apr 21, 2024
1 parent 2b6087b commit dbf0745
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/hfsfuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static int hfsfuse_open(const char* path, struct fuse_file_info* info) {
unsigned char* inlinedata;
if(fork == HFS_DATAFORK && !hfs_decmpfs_lookup(vol,&rec.file,&h,&inlinelength,&inlinedata)) {
f->decmpfs = hfs_decmpfs_create_context(vol,rec.file.cnid,inlinelength,inlinedata);
f->logical_size = h.logical_size;
free(inlinedata);
}
else f->nextents = hfslib_get_file_extents(vol,f->cnid,fork,&f->extents,NULL);
Expand Down

0 comments on commit dbf0745

Please sign in to comment.