Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (Re)HLDS exploit (Can't use keys or values with a ") #595

Merged
merged 1 commit into from
Apr 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion rehlds/engine/sv_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,11 @@ int SV_CheckUserInfo(netadr_t *adr, char *userinfo, qboolean bIsReconnecting, in
}
#endif

#ifdef REHLDS_FIXES
if (name[0] == 0 || !Q_stricmp(name, "console") || Q_strstr(name, "..") || Q_strstr(name, "\"") || Q_strstr(name, "\\"))
#else // REHLDS_FIXES
if (name[0] == 0 || !Q_stricmp(name, "console") || Q_strstr(name, "..") != NULL)
#endif // REHLDS_FIXES
{
Info_SetValueForKey(userinfo, "name", "unnamed", MAX_INFO_STRING);
}
Expand Down Expand Up @@ -4902,7 +4906,7 @@ void SV_ExtractFromUserinfo(client_t *cl)

if (newname[0] == '\0' || !Q_stricmp(newname, "console")
#ifdef REHLDS_FIXES
|| Q_strstr(newname, "..") != NULL)
|| Q_strstr(newname, "..") || Q_strstr(newname, "\"") || Q_strstr(newname, "\\"))
#else // REHLDS_FIXES
)
#endif // REHLDS_FIXES
Expand Down