diff options
| author | Duncan Lowther <Duncan.Lowther@glasgow.ac.uk> | 2023-06-08 16:22:17 +0100 |
|---|---|---|
| committer | Duncan Lowther <Duncan.Lowther@glasgow.ac.uk> | 2023-06-21 09:47:44 +0100 |
| commit | 25fb6515663f7541704d15068de280702e428042 (patch) | |
| tree | c45823c98e835d143e5399060001d2fb67f27b88 | |
| parent | ca79b4961953be587a290bc995ae925e664c9fbc (diff) | |
lib/oofatfs: Fix speculative read in create_name.
Signed-off-by: Duncan Lowther <Duncan.Lowther@glasgow.ac.uk>
| -rw-r--r-- | lib/oofatfs/ff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c index 0c9d04fe7..eca5b45bd 100644 --- a/lib/oofatfs/ff.c +++ b/lib/oofatfs/ff.c @@ -2821,7 +2821,7 @@ static FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not if (di >= FF_MAX_LFN) return FR_INVALID_NAME; /* Reject too long name */ lfn[di++] = wc; /* Store the Unicode character */ } - while (*p == '/' || *p == '\\') p++; /* Skip duplicated separators if exist */ + if (wc == '/' || wc == '\\') while (*p == '/' || *p == '\\') p++; /* Skip duplicated separators if exist */ *path = p; /* Return pointer to the next segment */ cf = (wc < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */ |
