mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-03-07 00:40:45 +00:00
Prevent an infinite loop in a fairly rare case, where the infostring is too
full to accept a new name when there is a duplicate name.
This commit is contained in:
parent
920de43af9
commit
759729b5a8
1 changed files with 8 additions and 0 deletions
|
@ -1758,6 +1758,14 @@ SV_ExtractFromUserinfo (client_t *cl)
|
|||
Info_SetValueForKey (cl->userinfo, "name", newname,
|
||||
MAX_INFO_STRING);
|
||||
val = Info_ValueForKey (cl->userinfo, "name");
|
||||
|
||||
// if the new name was not set (due to the info string being too long), drop the client to prevent an infinite loop
|
||||
if(strcmp(val, newname)) {
|
||||
SV_ClientPrintf (cl, PRINT_HIGH, "Please choose a different name.\n");
|
||||
Con_Printf("Client %d kicked for invalid name\n", cl->userid);
|
||||
SV_DropClient (cl);
|
||||
return;
|
||||
}
|
||||
} else
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue