-
Notifications
You must be signed in to change notification settings - Fork 130
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
Lack of checking of the fat32_bpb.bytes_per_sector #351
Comments
wjqsec
changed the title
Lack of checking of the fat32_bpb data
Lack of checking of the fat32_bpb.bytes_per_sector
May 17, 2024
mintsuki
added a commit
that referenced
this issue
May 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please consider adding a checking in common/fs/fat32.s2.c function fat32_init_context. The bpb.bytes_per_sector is directly used without checking if it is one of the four values (512, 1024, 2048, and 4096). If this value read from the hard drive is 0 which means the hard drive is corrupted, it will cause a divide-by-zero crash. A proper prompt should be given to the user that the hard drive is broken instead of using it directly.
Kind regards
The text was updated successfully, but these errors were encountered: