Skip to content

Commit 721c18d

Browse files
committed
Fixed writing past end of the buffer when loading personal item tracker notes longer than 8 characters
1 parent 4a8e6dc commit 721c18d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ void InitItemTracker() {
11021102
});
11031103
Ship::RegisterHook<Ship::LoadFile>([](uint32_t fileNum) {
11041104
const char* initialTrackerNotes = CVarGetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), "");
1105+
itemTrackerNotes.resize(strlen(initialTrackerNotes) + 1);
11051106
strcpy(itemTrackerNotes.Data, initialTrackerNotes);
11061107
});
11071108
Ship::RegisterHook<Ship::DeleteFile>([](uint32_t fileNum) {

0 commit comments

Comments
 (0)