From 1baa6be6de08c39a30db56ece886cdb3ff2add18 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 10 Sep 2015 14:21:47 +0200 Subject: [PATCH] debugger: enforce a null terminated char of a C-string CID 146728 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING) buffer_size_warning: Calling strncpy with a maximum size argument of 128 bytes on destination array mod.name of size 128 bytes might leave the destination string unterminated --- pcsx2/DebugTools/SymbolMap.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/pcsx2/DebugTools/SymbolMap.cpp b/pcsx2/DebugTools/SymbolMap.cpp index 8aecda2c15..faf31a2689 100644 --- a/pcsx2/DebugTools/SymbolMap.cpp +++ b/pcsx2/DebugTools/SymbolMap.cpp @@ -241,6 +241,7 @@ void SymbolMap::AddModule(const char *name, u32 address, u32 size) { ModuleEntry mod; strncpy(mod.name, name, ARRAY_SIZE(mod.name)); + mod.name[ARRAY_SIZE(mod.name) - 1] = 0; mod.start = address; mod.size = size; mod.index = (int)modules.size() + 1;