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
|
@ -2639,7 +2639,9 @@ void R_AddSkins(UINT16 wadnum)
|
||||||
else if (!stricmp(stoken, "availability"))
|
else if (!stricmp(stoken, "availability"))
|
||||||
{
|
{
|
||||||
skin->availability = atoi(value);
|
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);
|
STRBUFCPY(unlockables[skin->availability - 1].name, skin->realname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue