From e8e4afbbcd7963ec0007ea0cf3a444a1016a7a4d Mon Sep 17 00:00:00 2001 From: Evgenii Babinets Date: Thu, 23 Feb 2023 01:13:32 -0500 Subject: [PATCH] Fixed potential memory corruption when loading personal item tracker notes (#2512) --- soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 0c81e8139..730ff7563 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -1102,6 +1102,7 @@ void InitItemTracker() { }); Ship::RegisterHook([](uint32_t fileNum) { const char* initialTrackerNotes = CVarGetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); + itemTrackerNotes.resize(strlen(initialTrackerNotes) + 1); strcpy(itemTrackerNotes.Data, initialTrackerNotes); }); Ship::RegisterHook([](uint32_t fileNum) {