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

Lack of checking of the fat32_bpb.bytes_per_sector #351

Closed
wjqsec opened this issue May 17, 2024 · 0 comments
Closed

Lack of checking of the fat32_bpb.bytes_per_sector #351

wjqsec opened this issue May 17, 2024 · 0 comments

Comments

@wjqsec
Copy link

wjqsec commented May 17, 2024

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

@wjqsec 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
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

No branches or pull requests

2 participants