From 721c18d4884f0e5787b7a8196ed536841b336207 Mon Sep 17 00:00:00 2001 From: Evgenii Babinets Date: Mon, 20 Feb 2023 13:56:26 -0500 Subject: [PATCH] Fixed writing past end of the buffer when loading personal item tracker notes longer than 8 characters --- 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) {