From ff793da7d320eb6b35f223f57d6dabc5d9685354 Mon Sep 17 00:00:00 2001 From: Christopher Williams Date: Tue, 4 Sep 2018 17:29:56 -0700 Subject: [PATCH] R0.13b patch 3 Sep 3, 2018 f_getcwd function uses memory location beyond the output buffer length specified by argument if the buffer has a valid drive number. It can collapse the data located next to the output buffer. This problem was reported via email. --- source/ff.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/ff.c b/source/ff.c index 4293e38..a818543 100644 --- a/source/ff.c +++ b/source/ff.c @@ -4145,6 +4145,7 @@ FRESULT f_getcwd ( /* Get logical drive */ + buff[0] = 0; /* Set null string to get current volume */ res = find_volume((const TCHAR**)&buff, &fs, 0); /* Get current volume */ if (res == FR_OK) { dj.obj.fs = fs;