Fix buffer overflow when when fetching typenames on freeslots

This commit is contained in:
Gustaf Alhäll 2023-11-01 17:31:17 +01:00
parent dfd05c6172
commit 9013ceeacc
No known key found for this signature in database
GPG key ID: 6C1F67D690CDEDFD

View file

@ -236,6 +236,8 @@ static const char *MobjTypeName(const mobj_t *mobj)
{
if (mobj->thinker.debug_mobjtype != MT_NULL)
{
if (mobj->thinker.debug_mobjtype >= MT_FIRSTFREESLOT)
return "MT_FREESLOT";
return MOBJTYPE_LIST[mobj->thinker.debug_mobjtype];
}
}