Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 74 #110

Merged
merged 2 commits into from
Dec 17, 2023
Merged

Fix issue 74 #110

merged 2 commits into from
Dec 17, 2023

Conversation

thejpster
Copy link
Member

Map ROOT_DIR (0xFFFF_FFFC) to an actual cluster number, so if you go off the end of the first cluster of the root directory on FAT32, the code no longer crashes trying to convert the ROOT_DIR magic cluster number into a disk offset.

Also adds an example which replicates the issue by writing an infinite number of files to the root directory.

Closes #74

Map ROOT_DIR (0xFFFF_FFFC) to an actual cluster number, so if you go off the end of the first cluster of the root directory on FAT32, the code no longer crashes trying to convert the ROOT_DIR magic cluster number into a disk offset.
Copy link
Contributor

@jannic jannic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't claim that I understood this in detail, but the explanation sounds sensible, and the code seems to match the explanation. So probably it's either correct or it was written by ChatGPT :-)

@thejpster thejpster added this pull request to the merge queue Dec 17, 2023
Merged via the queue into develop with commit 85d32e6 Dec 17, 2023
8 checks passed
@thejpster thejpster deleted the fix-issue-74 branch July 12, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

u32 overflow in finding fat_offset from cluster
2 participants