Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wootguy committed Oct 31, 2024
1 parent 0ab9d35 commit 247bba1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dlls/CBasePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4500,10 +4500,13 @@ void CBasePlayer :: UpdateClientData( void )
void CBasePlayer::Rename(const char* newName, bool fast, int msg_mode, edict_t* dst) {
char* info = g_engfuncs.pfnGetInfoKeyBuffer(edict());

if (!info || info[0] == '\0') {
return;
}

// not doing this because it triggers the "changed name" chat message
//g_engfuncs.pfnSetClientKeyValue(entindex(), info, "name", (char*)newName);


static char userinfo[512];

if (fast) {
Expand Down Expand Up @@ -4540,9 +4543,11 @@ void CBasePlayer::Rename(const char* newName, bool fast, int msg_mode, edict_t*
return;
}



char* nameStart = strstr(info, "\\name\\") + 6;
if (!nameStart) {
return;
}

char* nameEnd = strstr(nameStart, "\\");

if (strlen(info) + strlen(newName) > 512 && nameStart) {
Expand Down

0 comments on commit 247bba1

Please sign in to comment.