Inventory bounds checking error


Strife contains two different errors in the programming of its player inventory system:

  • The last slot of the inventory, slot number 32 (index 31 when counting from 0), is completely unusable because of sloppy bounds checking (the logic is off by one when testing for the maximum allowed inventory index).
  • If the player acquires more than 31 distinct inventory items, portions of the player structure will be overwritten in memory, leading to bizarre side effects and a fairly reliable crash. This error does not generally come to bear in the stock game, but can be observed easily with SeHackEd by making additional objects into inventory items.