limine-bootloader/limine

Lack of checking of the fat32_bpb.bytes_per_sector

wjqsec opened this issue · 0 comments

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