Skip to content

Commit f3e8614

Browse files
authored
[SP] Crash when filling SteerUser neighbors (out of bounds vector access) (#1149)
We loop over EntityList, which can contain MAX_GENTITIES values, but mNeighbors can only contain STEER::MAX_NEIGHBORS values.
1 parent 4e5fc65 commit f3e8614

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/game/g_navigator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4151,7 +4151,7 @@ void STEER::Activate(gentity_t* actor)
41514151
gentity_t* neighbor = 0;
41524152

41534153
int numFound = gi.EntitiesInBox(Mins.v, Maxs.v, EntityList, MAX_GENTITIES);
4154-
for (int i=0; i<numFound; i++)
4154+
for (int i=0; i<numFound && !suser.mNeighbors.full(); i++)
41554155
{
41564156
neighbor = EntityList[i];
41574157
assert(neighbor!=0);

0 commit comments

Comments
 (0)