mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: client: prevent a crash in case of invalid tempentity message (thanks, @Aynekko!)
This commit is contained in:
@@ -2050,6 +2050,14 @@ void CL_ParseTempEntity( sizebuf_t *msg, connprotocol_t proto )
|
||||
else entityIndex = 0;
|
||||
|
||||
pEnt = CL_GetEntityByIndex( entityIndex );
|
||||
|
||||
// this might be obvious, but do not exit _before_ all data has been read or we will get parsing error later
|
||||
if( !pEnt )
|
||||
{
|
||||
Con_Reportf( "%s: ignored temp entity message %d, invalid entity num %d\n", __func__, type, entityIndex );
|
||||
break;
|
||||
}
|
||||
|
||||
modelIndex = pEnt->curstate.modelindex;
|
||||
}
|
||||
CL_DecalShoot( CL_DecalIndex( decalIndex ), entityIndex, modelIndex, pos, type == TE_BSPDECAL ? FDECAL_PERMANENT : 0 );
|
||||
|
||||
Reference in New Issue
Block a user