Strncpy doesn't terminate correctly, switch to truncate_cpy.

This commit is contained in:
Henrik Rydgård 2017-05-26 18:26:26 +02:00
parent 4b46bb4ecf
commit 083f7ff280

View File

@ -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);
}