From 1176ae6512c6a3ae271fef7b1ae45c5e8d5d822e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 19 Apr 2018 14:12:06 +0200 Subject: [PATCH] IOS/FS: Fix ReadDirectory file list copying Each entry can take up to 13 bytes (including the terminating null character) but should not be aligned to 13 bytes. --- Source/Core/Core/IOS/FS/FileSystemProxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/IOS/FS/FileSystemProxy.cpp b/Source/Core/Core/IOS/FS/FileSystemProxy.cpp index 2301cf7cad..587577d497 100644 --- a/Source/Core/Core/IOS/FS/FileSystemProxy.cpp +++ b/Source/Core/Core/IOS/FS/FileSystemProxy.cpp @@ -467,7 +467,7 @@ IPCCommandResult FS::ReadDirectory(const Handle& handle, const IOCtlVRequest& re Memory::Memset(file_list_address, 0, 13); Memory::CopyToEmu(file_list_address, (*list)[i].data(), (*list)[i].size()); Memory::Write_U8(0, file_list_address + 12); - file_list_address += 13; + file_list_address += static_cast((*list)[i].size()) + 1; } // Write the actual number of entries in the buffer. Memory::Write_U32(std::min(max_count, static_cast(list->size())), file_count_address);