From: havoc Date: Tue, 8 Jul 2003 10:06:53 +0000 (+0000) Subject: check svc_setview against MAX_EDICTS X-Git-Tag: xonotic-v0.1.0preview~6555 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=f25ca65c3209d4d966ddb6e8f3f1599666d0325a;p=xonotic%2Fdarkplaces.git check svc_setview against MAX_EDICTS git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3191 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 357b47c3..77a8a183 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1530,7 +1530,9 @@ void CL_ParseServerMessage(void) break; case svc_setview: - cl.viewentity = MSG_ReadShort (); + cl.viewentity = (unsigned short)MSG_ReadShort (); + if (cl.viewentity >= MAX_EDICTS) + Host_Error("svc_setview >= MAX_EDICTS\n"); // LordHavoc: assume first setview recieved is the real player entity if (!cl.playerentity) cl.playerentity = cl.viewentity;