mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-16 01:11:28 +00:00
net.c: move a necessary bound check to BEFORE the oob access happening.
Fixes the undefined behavior discussed here: http://forums.duke4.net/topic/3857-the-crash-thread/page__view__findpost__p__152612 git-svn-id: https://svn.eduke32.com/eduke32@4008 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ae65ba0013
commit
d095ebf9b2
1 changed files with 5 additions and 5 deletions
|
@ -1098,17 +1098,17 @@ void Net_SaveMapState(netmapstate_t *save)
|
|||
i = headspritestat[g_netStatnums[statIndex]];
|
||||
for (; i >= 0; i = nextspritestat[i])
|
||||
{
|
||||
if (save->numActors >= NETMAXACTORS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (Net_IsRelevantSprite(i) && sprite[i].statnum != STAT_NETALLOC)
|
||||
{
|
||||
netactor_t *tempActor = &save->actor[save->numActors];
|
||||
Net_CopyToNet(i, tempActor);
|
||||
save->numActors++;
|
||||
}
|
||||
|
||||
if (save->numActors >= NETMAXACTORS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue