mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
Coderjoe's fix from newtree. (The other part of the DOS fix.)
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
b264cdd28b
commit
98a8db2f0e
1 changed files with 12 additions and 0 deletions
|
@ -1805,6 +1805,18 @@ 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