Skip to content

Commit 25fb651

Browse files
committed
lib/oofatfs: Fix speculative read in create_name.
Signed-off-by: Duncan Lowther <[email protected]>
1 parent ca79b49 commit 25fb651

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/oofatfs/ff.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2821,7 +2821,7 @@ static FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not
28212821
if (di >= FF_MAX_LFN) return FR_INVALID_NAME; /* Reject too long name */
28222822
lfn[di++] = wc; /* Store the Unicode character */
28232823
}
2824-
while (*p == '/' || *p == '\\') p++; /* Skip duplicated separators if exist */
2824+
if (wc == '/' || wc == '\\') while (*p == '/' || *p == '\\') p++; /* Skip duplicated separators if exist */
28252825
*path = p; /* Return pointer to the next segment */
28262826
cf = (wc < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */
28272827

0 commit comments

Comments
 (0)