From 83f445f0507428a7ff6cf8793e7aa4624aacb5d6 Mon Sep 17 00:00:00 2001 From: Joe Eagar Date: Sun, 28 Apr 2019 00:38:35 -0700 Subject: [PATCH] Fixed heap overrun error --- Source/Project64/UserInterface/Debugger/ScriptSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp b/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp index db7c34c42..41693feeb 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp +++ b/Source/Project64/UserInterface/Debugger/ScriptSystem.cpp @@ -70,7 +70,7 @@ const char* CScriptSystem::APIScript() void CScriptSystem::RunScript(char* path) { CScriptInstance* scriptInstance = new CScriptInstance(m_Debugger); - char* pathSaved = (char*)malloc(strlen(path)); // freed via DeleteStoppedInstances + char* pathSaved = (char*)malloc(strlen(path)+1); // freed via DeleteStoppedInstances strcpy(pathSaved, path); m_RunningInstances.push_back({ pathSaved, scriptInstance }); scriptInstance->Start(pathSaved);