From a7eb2e79e536bdbfcd7345385d31876834bca425 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 16 Apr 2015 15:44:06 -0400 Subject: [PATCH] Memory Labels Class: Correct bounds clamping in ProcessCODFile --- Source/Project64/N64 System/Mips/Memory Labels Class.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index 243e19b31..2830e3141 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -208,10 +208,10 @@ void CMemoryLabel::ProcessCODFile(BYTE * File, DWORD FileLen) } } - if (Length > 40) - { - Length = 40; - } + // Stay within label array bounds + if (Length > 39) + Length = 39; + memcpy(Label,CurrentPos,Length); Label[Length] = '\0';