From 7ef781c24c6e251d6e55aed53b67bd945da1de1c Mon Sep 17 00:00:00 2001 From: mucor Date: Wed, 4 Aug 2021 09:44:30 +0800 Subject: [PATCH] fix: fix long file name buffer overflow check at 254 length close: #I43S7Z Signed-off-by: mucor --- source/ff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ff.c b/source/ff.c index 21c2438..116c592 100644 --- a/source/ff.c +++ b/source/ff.c @@ -1662,7 +1662,7 @@ static int pick_lfn ( /* 1:succeeded, 0:buffer overflow or invalid LFN entry */ } if (dir[LDIR_Ord] & LLEF) { /* Put terminator if it is the last LFN part */ - if (i >= FF_MAX_LFN) return 0; /* Buffer overflow? */ + if (i > FF_MAX_LFN) return 0; /* Buffer overflow? */ lfnbuf[i] = 0; } -- GitLab