Browse Source

Fix OOB array access when spawning arena pots

calling this with a full inventory would write past the end of InvList, potentially causing a crash or data corruption.
pull/6081/head
ephphatha 3 years ago committed by Gleb Mazovetskiy
parent
commit
b102dccf81
  1. 2
      Source/control.cpp

2
Source/control.cpp

@ -414,7 +414,7 @@ std::string TextCmdArenaPot(const string_view parameter)
Player &myPlayer = *MyPlayer;
for (int potNumber = std::max(1, atoi(parameter.data())); potNumber > 0; potNumber--) {
Item &item = myPlayer.InvList[myPlayer._pNumInv];
Item item {};
InitializeItem(item, IDI_ARENAPOT);
GenerateNewSeed(item);
item.updateRequiredStatsCacheForPlayer(myPlayer);

Loading…
Cancel
Save