diff --git a/Source/Core/Common/FatFsUtil.cpp b/Source/Core/Common/FatFsUtil.cpp index 0176178b3a..f247ae3f73 100644 --- a/Source/Core/Common/FatFsUtil.cpp +++ b/Source/Core/Common/FatFsUtil.cpp @@ -615,6 +615,13 @@ static bool Unpack(const std::string path, bool is_directory, const char* name, if (entry.fname[0] == '\0') break; + if (entry.fname[0] == '?' && entry.fname[1] == '\0' && entry.altname[0] == '\0') + { + // FATFS indicates entries that have neither a short nor a long filename this way. + // These are likely corrupted file entries so just skip them. + continue; + } + const std::string_view childname = entry.fname; // Check for path traversal attacks.