From f414f25cfc4325f2735990610b68f5ecb815b172 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 11 Jul 2023 15:35:19 +0100 Subject: Log if a user specifies an invalid country code in . --- src/modules/m_geoclass.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/modules/m_geoclass.cpp') diff --git a/src/modules/m_geoclass.cpp b/src/modules/m_geoclass.cpp index 44e0de209..d613b91d4 100644 --- a/src/modules/m_geoclass.cpp +++ b/src/modules/m_geoclass.cpp @@ -60,6 +60,13 @@ class ModuleGeoClass irc::spacesepstream codes(country); for (std::string token; codes.GetToken(token); ) { + if (token.length() != 2) + { + ServerInstance->Logs->Log("CONNECTCLASS", LOG_DEBUG, "The %s connect class contains an invalid country code: %s", + myclass->GetName().c_str(), token.c_str()); + continue; + } + // If the user matches this country code then they can use this // connect class. if (stdalgo::string::equalsci(token, code)) -- cgit v1.3.1-10-gc9f91