Merge branch 'fix-give-command-bounds' into 'master'

Fix potential out-of-bounds exploit with give command

Closes #698

See merge request KartKrew/Kart!1874
This commit is contained in:
Oni 2024-01-28 19:26:17 +00:00
commit 22e2b97171

View file

@ -6069,6 +6069,8 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum)
UINT8 powerup = READUINT8(*cp);
UINT16 time = READUINT16(*cp);
powerup = min(powerup, LASTPOWERUP);
// FIXME: we should have actual KITEM_ name array
const char *powerupname = cv_kartdebugitem.PossibleValue[
1 + NUMKARTITEMS + (powerup - FIRSTPOWERUP)].strvalue;