0x09 / hfsfuse

FUSE driver for HFS+ filesystems
Other
77 stars 13 forks source link

Always compare the entire key in HFSX binary comparisons #3

Closed DHowett closed 6 years ago

DHowett commented 6 years ago

The memcmp in hfslib_compare_catalog_keys_bc only checks roughly half of the provided key. This led to lookups on "dir_205123" returning the entry for another catalog entry, "dir_205789", which shares a prefix.

This failure's reproduceability is of course contingent upon B-tree node ordering.

Signed-off-by: Dustin L. Howett dustin@howett.net

DHowett commented 6 years ago

This was discovered through manual testing. hfsfuse was returning unusual directory contents for an old case-sensitive time machine volume.

0x09 commented 6 years ago

Great catch! You may want to consider reporting this upstream to NetBSD as well.

DHowett commented 6 years ago

Thanks! I actually ended up running into another issue in this function. I'll submit another pull request with the fix. :smile: