2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-16 00:28:20 +03:00

Fix possible null dereferences (#443)

* Fix possible null dereference in R_StudioCalcBonePosition

* Fix possible null dereference in NET_LagPacket

* Fix possible null dereference in SV_CreatePacketEntities_internal
This commit is contained in:
In-line 2017-04-27 18:55:25 +04:00 committed by Lev
parent 66fea521a8
commit f812b2ea2e
3 changed files with 13 additions and 1 deletions

View File

@ -784,7 +784,11 @@ qboolean NET_LagPacket(qboolean newdata, netsrc_t sock, netadr_t *from, sizebuf_
}
curtime = realtime;
#ifdef REHLDS_FIXES
if (newdata && data)
#else
if (newdata)
#endif
{
if (fakeloss.value != 0.0)
{

View File

@ -458,7 +458,11 @@ void R_StudioCalcBonePosition(int frame, float s, mstudiobone_t *pbone, mstudioa
}
}
}
#ifdef REHLDS_FIXES
if (adj && pbone->bonecontroller[j] != -1)
#else
if (pbone->bonecontroller[j] != -1)
#endif
{
pos[j] += adj[pbone->bonecontroller[j]];
}

View File

@ -4329,8 +4329,12 @@ int SV_CreatePacketEntities_internal(sv_delta_t type, client_t *client, packet_e
else
newindex = 9999;
}
#ifdef REHLDS_FIXES
if (oldnum < oldmax && from)
#else
if (oldnum < oldmax)
#endif
oldindex = from->entities[oldnum].number;
else
oldindex = 9999;