2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Fix crash in ProcessStringCmd (#838)

This commit is contained in:
Juice 2021-06-11 20:01:01 +03:00 committed by GitHub
parent 0c47c1c28b
commit 05c7601f1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -86,6 +86,11 @@ bool ProxyClient::ProcessStringCmd(char *string)
return true; return true;
} }
if (!cmdLine.CountToken()) {
m_System->DPrintf("WARNING! ProxyClient::ProcessStringCmd: invalid command string.\n");
return false;
}
char *cmd = cmdLine.GetToken(0); char *cmd = cmdLine.GetToken(0);
for (auto& local_cmd : m_LocalCmdReg) for (auto& local_cmd : m_LocalCmdReg)
{ {

View File

@ -266,6 +266,11 @@ bool BaseClient::ProcessStringCmd(char *string)
return false; return false;
} }
if (!cmdLine.CountToken()) {
m_System->DPrintf("WARNING! BaseClient::ProcessStringCmd: invalid command string.\n");
return false;
}
char *cmd = cmdLine.GetToken(0); char *cmd = cmdLine.GetToken(0);
for (auto& local_cmd : m_LocalCmdReg) for (auto& local_cmd : m_LocalCmdReg)
{ {