Add additional check in fatfs_get_file_sectors

This commit is contained in:
Mateusz Faderewski 2024-05-21 18:06:57 +02:00
parent 7670ffe6ba
commit 2dc83c49ed

View File

@ -51,7 +51,7 @@ bool fatfs_get_file_sectors (char *path, uint32_t *address, address_type_t type,
uint32_t cluster = fil.clust; uint32_t cluster = fil.clust;
if (cluster >= fs->n_fatent) { if ((cluster < 2) || (cluster >= fs->n_fatent)) {
error = true; error = true;
break; break;
} }