nathanhi / pyfatfs

Python based FAT12/FAT16/FAT32 implementation with VFAT support
https://pypi.org/project/pyfatfs/
MIT License
29 stars 14 forks source link

Fix bug in parsing LFNs when opening multiple file systems #6

Closed koolkdev closed 3 years ago

koolkdev commented 3 years ago

The argument for tmp_lfn_entry is initialized to a global of FATLongDirectoryEntry object. So multiple filesystems objects are going to use the same tmp_lfn_entry when calling _fat12_parse_root_dir, which in some cases cause a failure in add_lfn_entry because tmp_lfn_entry.lfn_entries may be already populated with that ordinance.

I also changed the argument to is_lfn_entry to the correct one. It doesn't fix any bad behavior, because that byte was already checked before.

nathanhi commented 3 years ago

Oops, what an oversight.. Thanks for the fix!