mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Bug Fix] Fix Crash in ClientList::GetCLEIP (#4173)
* [Bug Fix] Fix Crash in ClientList::GetCLEIP # Notes - We were not validating pointer when moving to next iterator. # Crashes https://spire.akkadius.com/dev/release/22.46.1?id=19955 https://spire.akkadius.com/dev/release/22.46.1?id=19948 https://spire.akkadius.com/dev/release/22.46.0?id=19945 * Update clientlist.cpp * Update clientlist.cpp
This commit is contained in:
parent
5013459824
commit
957b4f8821
@ -94,12 +94,20 @@ void ClientList::GetCLEIP(uint32 in_ip) {
|
||||
int count = 0;
|
||||
iterator.Reset();
|
||||
|
||||
const auto& zones = Strings::Split(RuleS(World, IPExemptionZones), ",");
|
||||
|
||||
while (iterator.MoreElements()) {
|
||||
cle = iterator.GetData();
|
||||
|
||||
const auto zones = Strings::Split(RuleS(World, IPExemptionZones), ",");
|
||||
for (const auto &z : zones) {
|
||||
if (Strings::ToUnsignedInt(z) == cle->zone()) {
|
||||
|
||||
if (!zones.empty() && cle->zone()) {
|
||||
auto it = std::ranges::find_if(
|
||||
zones,
|
||||
[cle](const auto& z) {
|
||||
return Strings::ToUnsignedInt(z) == cle->zone();
|
||||
}
|
||||
);
|
||||
|
||||
if (it != zones.end()) {
|
||||
iterator.Advance();
|
||||
continue;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user