Consistently limit the range for config port fields.

This commit is contained in:
Sadie Powell 2022-12-19 09:48:16 +00:00
parent be6555384d
commit 4dff02f7ed
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ class ModuleIRCv3STS : public Module
if (host.empty())
throw ModuleException("<sts:host> must contain a hostname, at " + tag->getTagLocation());
unsigned int port = tag->getUInt("port", 0, 0, UINT16_MAX);
unsigned int port = tag->getUInt("port", 6697, 1, 65535);
if (!HasValidSSLPort(port))
throw ModuleException("<sts:port> must be a TLS port, at " + tag->getTagLocation());

View File

@ -272,7 +272,7 @@ void SpanningTreeUtilities::ReadConfiguration()
if (path.empty())
{
L->IPAddr = tag->getString("ipaddr");
L->Port = tag->getUInt("port", 0);
L->Port = tag->getUInt("port", 0, 1, 65535);
}
else
{