From 083f7ff2806380961ad0fed78fdeaf595e9b4596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 26 May 2017 18:26:26 +0200 Subject: [PATCH] Strncpy doesn't terminate correctly, switch to truncate_cpy. --- Core/HLE/sceKernelModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 8439350372..85b8449c76 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -22,6 +22,7 @@ #include "base/stringutil.h" #include "Common/ChunkFile.h" #include "Common/FileUtil.h" +#include "Common/StringUtils.h" #include "Core/Config.h" #include "Core/HLE/HLE.h" #include "Core/HLE/FunctionWrappers.h" @@ -312,7 +313,7 @@ public: } char moduleName[29] = {0}; - strncpy(moduleName, nm.name, ARRAY_SIZE(nm.name)); + truncate_cpy(moduleName, nm.name); if (memoryBlockAddr != 0) { g_symbolMap->AddModule(moduleName, memoryBlockAddr, memoryBlockSize); }