From b6956d7bc8286d278bd940742635eb40aa2e4473 Mon Sep 17 00:00:00 2001 From: "sonika.rathi" Date: Tue, 26 Aug 2025 13:44:25 +0200 Subject: [PATCH] fix(fatfs): fix overflowed constant issue observed in mount_volume of ff.c --- components/fatfs/src/ff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/fatfs/src/ff.c b/components/fatfs/src/ff.c index 3c3f1ace61..834637a4a0 100644 --- a/components/fatfs/src/ff.c +++ b/components/fatfs/src/ff.c @@ -3448,7 +3448,7 @@ static FRESULT mount_volume ( /* FR_OK(0): successful, !=0: an error occurred */ /* Find an FAT volume on the hosting drive */ fmt = find_volume(fs, LD2PT(vol)); - if (fmt == 4) return FR_DISK_ERR; /* An error occurred in the disk I/O layer */ + if (fmt == 4 || fs->winsect == 0xFFFFFFFF) return FR_DISK_ERR; /* An error occurred in the disk I/O layer */ if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */ bsect = fs->winsect; /* Volume offset in the hosting physical drive */