]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
check svc_setview against MAX_EDICTS
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Jul 2003 10:06:53 +0000 (10:06 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Jul 2003 10:06:53 +0000 (10:06 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3191 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c

index 357b47c3783a60837bf10d8b0568e26432ae0257..77a8a1834254a10ae0cb1a641f4cbd2baeec5950 100644 (file)
@@ -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;