mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 18:32:08 +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…
Reference in a new issue