Fix an off-by-one in memmove() call in SV_Map()

Submitted by: Ozkan Sezer
This commit is contained in:
Yamagi Burmeister 2015-08-24 18:02:08 +02:00
parent c0fac70763
commit bd025ae5c5

View file

@ -377,7 +377,7 @@ SV_InitGame(void)
svs.spawncount = randk(); svs.spawncount = randk();
svs.clients = Z_Malloc(sizeof(client_t) * maxclients->value); svs.clients = Z_Malloc(sizeof(client_t) * maxclients->value);
svs.num_client_entities = maxclients->value * UPDATE_BACKUP * 64; svs.num_client_entities = maxclients->value * UPDATE_BACKUP * 64;
svs.client_entities = svs.client_entities =
Z_Malloc( sizeof(entity_state_t) * svs.num_client_entities); Z_Malloc( sizeof(entity_state_t) * svs.num_client_entities);
/* init network stuff */ /* init network stuff */
@ -463,13 +463,14 @@ SV_Map(qboolean attractloop, char *levelstring, qboolean loadgame)
} }
/* skip the end-of-unit flag if necessary */ /* skip the end-of-unit flag if necessary */
l = strlen(level);
if (level[0] == '*') if (level[0] == '*')
{ {
memmove(level, level + 1, strlen(level) + 1); memmove(level, level + 1, l);
--l;
} }
l = strlen(level);
if ((l > 4) && !strcmp(level + l - 4, ".cin")) if ((l > 4) && !strcmp(level + l - 4, ".cin"))
{ {
#ifndef DEDICATED_ONLY #ifndef DEDICATED_ONLY