mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-27 14:30:30 +00:00
fix unhandled out of bounds in Authentication
This commit is contained in:
1 file changed
+4
@@ -277,7 +277,11 @@ std::shared_ptr<TClient> TNetwork::Authentication(TConnection&& RawConnection) {
|
|||||||
for (const auto& ID : AuthRes["identifiers"]) {
|
for (const auto& ID : AuthRes["identifiers"]) {
|
||||||
auto Raw = std::string(ID);
|
auto Raw = std::string(ID);
|
||||||
auto SepIndex = Raw.find(':');
|
auto SepIndex = Raw.find(':');
|
||||||
|
if (SepIndex != std::string::npos) {
|
||||||
Client->SetIdentifier(Raw.substr(0, SepIndex), Raw.substr(SepIndex + 1));
|
Client->SetIdentifier(Raw.substr(0, SepIndex), Raw.substr(SepIndex + 1));
|
||||||
|
} else {
|
||||||
|
beammp_errorf("Invalid response from auth servers: No ':' in identifier '{}', ignoring it", Raw);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
beammp_error("Invalid authentication data received from authentication backend");
|
beammp_error("Invalid authentication data received from authentication backend");
|
||||||
|
|||||||
Reference in new issue
Block a user