mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-08 02:48:34 +00:00
Validate ent index bounds in LookupEntity (bug 5080, r=fyren).
This commit is contained in:
parent
17e630caab
commit
42c287bb2a
@ -786,6 +786,12 @@ CBaseEntity *CHalfLife2::ReferenceToEntity(cell_t entRef)
|
||||
*/
|
||||
CEntInfo *CHalfLife2::LookupEntity(int entIndex)
|
||||
{
|
||||
// Make sure that our index is within the bounds of the global ent array
|
||||
if (entIndex < 0 || entIndex >= NUM_ENT_ENTRIES)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!g_EntList || entInfoOffset == -1)
|
||||
{
|
||||
/* Attempt to use engine interface instead */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user