Skip to content

Commit

Permalink
[SP] Crash when filling SteerUser neighbors (out of bounds vector acc…
Browse files Browse the repository at this point in the history
…ess) (#1149)

We loop over EntityList, which can contain MAX_GENTITIES values, but
mNeighbors can only contain STEER::MAX_NEIGHBORS values.
  • Loading branch information
V-Sarthou committed Sep 29, 2023
1 parent 4e5fc65 commit f3e8614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/game/g_navigator.cpp
Expand Up @@ -4151,7 +4151,7 @@ void STEER::Activate(gentity_t* actor)
gentity_t* neighbor = 0;

int numFound = gi.EntitiesInBox(Mins.v, Maxs.v, EntityList, MAX_GENTITIES);
for (int i=0; i<numFound; i++)
for (int i=0; i<numFound && !suser.mNeighbors.full(); i++)
{
neighbor = EntityList[i];
assert(neighbor!=0);
Expand Down

0 comments on commit f3e8614

Please sign in to comment.