mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-09 01:22:53 +00:00
Realised the potential for out-of-bounds memory accessing, so put some limits in place to prevent that from happening.
(skin->availability is a UINT8, so it'll never be negative)
This commit is contained in:
parent
caed5718c1
commit
417e9187d9
1 changed files with 3 additions and 1 deletions
|
|
@ -2639,7 +2639,9 @@ void R_AddSkins(UINT16 wadnum)
|
|||
else if (!stricmp(stoken, "availability"))
|
||||
{
|
||||
skin->availability = atoi(value);
|
||||
if (skin->availability && (skin->availability < MAXUNLOCKABLES))
|
||||
if (skin->availability >= MAXUNLOCKABLES)
|
||||
skin->availability = 0;
|
||||
if (skin->availability)
|
||||
STRBUFCPY(unlockables[skin->availability - 1].name, skin->realname);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue