From f1472e74d13f20703ca0c28c7c7bb4baff756b7c Mon Sep 17 00:00:00 2001 From: Snapchip <71973715+Snapchip@users.noreply.github.com> Date: Fri, 6 Nov 2020 12:49:33 +0200 Subject: [PATCH] fixes #28 --- PlugY/InfinityStash.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PlugY/InfinityStash.cpp b/PlugY/InfinityStash.cpp index 22c39bf..764fe9b 100644 --- a/PlugY/InfinityStash.cpp +++ b/PlugY/InfinityStash.cpp @@ -268,7 +268,7 @@ DWORD loadStash(Unit* ptChar, Stash* ptStash, BYTE data[], DWORD startSize, DWOR // if (strlen((char *)&data[curSize]) > 0xF) // *(char *)&data[curSize+0xF] = NULL; if (strlen((char *)&data[curSize])) - ptStash->name = (char*)malloc(strlen((char *)&data[curSize]));//D2AllocMem(PCGame->memoryPool, strlen((char *)&data[curSize]),__FILE__,__LINE__,0); + ptStash->name = (char*)malloc(strlen((char *)&data[curSize]) + 1);//D2AllocMem(PCGame->memoryPool, strlen((char *)&data[curSize]),__FILE__,__LINE__,0); if (ptStash->name) strcpy(ptStash->name, (char *)&data[curSize]); curSize += strlen((char *)&data[curSize]) + 1; @@ -543,7 +543,7 @@ void renameCurrentStash(Unit* ptChar, char* name) log_msg("renameCurrentStash 3\n"); if (len > 0) { - stash->name = (char *)malloc(len);//D2FogMemAlloc(len,__FILE__,__LINE__,0); + stash->name = (char *)malloc(len + 1);//D2FogMemAlloc(len,__FILE__,__LINE__,0); strcpy(stash->name, name); } else