X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=cl_parse.c;h=9095337523c72768012e9046beb604c2653a9e2f;hb=569035fb5d987a2ebcac65c5c2657d86556c24b3;hp=9a7ad21ac75c0d1306aba779731db1adafb42acb;hpb=af0b7a1fa11c2ceedeb9f66ca950f6c0bff8ad8f;p=xonotic%2Fdarkplaces.git diff --git a/cl_parse.c b/cl_parse.c index 9a7ad21a..90953375 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -230,14 +230,14 @@ void CL_ParseEntityLump(char *entdata) if (com_token[0] == '}') break; // end of worldspawn if (com_token[0] == '_') - strcpy(key, com_token + 1); + strlcpy (key, com_token + 1, sizeof (key)); else - strcpy(key, com_token); + strlcpy (key, com_token, sizeof (key)); while (key[strlen(key)-1] == ' ') // remove trailing spaces key[strlen(key)-1] = 0; if (!COM_ParseToken(&data, false)) return; // error - strcpy(value, com_token); + strlcpy (value, com_token, sizeof (value)); if (!strcmp("sky", key)) R_SetSkyBox(value); else if (!strcmp("skyname", key)) // non-standard, introduced by QuakeForge... sigh. @@ -382,7 +382,7 @@ void CL_ParseServerInfo (void) Host_Error ("Server sent too many model precaches\n"); if (strlen(str) >= MAX_QPATH) Host_Error ("Server sent a precache name of %i characters (max %i)", strlen(str), MAX_QPATH - 1); - strcpy(parse_model_precache[nummodels], str); + strlcpy (parse_model_precache[nummodels], str, sizeof (parse_model_precache[nummodels])); } // parse sound precache list for (numsounds=1 ; ; numsounds++) @@ -394,7 +394,7 @@ void CL_ParseServerInfo (void) Host_Error("Server sent too many sound precaches\n"); if (strlen(str) >= MAX_QPATH) Host_Error("Server sent a precache name of %i characters (max %i)", strlen(str), MAX_QPATH - 1); - strcpy(parse_sound_precache[numsounds], str); + strlcpy (parse_sound_precache[numsounds], str, sizeof (parse_sound_precache[numsounds])); } // touch all of the precached models that are still loaded so we can free @@ -807,6 +807,7 @@ void CL_ParseClientdata (int bits) cl.stats[STAT_CELLS] = MSG_ReadByte(); i = MSG_ReadByte (); + if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE) i = (1<