From 8bc996bcc1444b33ccfde6ca3588deee0a0459d1 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 18 Feb 2019 15:43:22 +0000 Subject: Fix MatchCIDR matching UNIX socket hostnames. --- src/cidr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cidr.cpp b/src/cidr.cpp index 250ad9c69..377611437 100644 --- a/src/cidr.cpp +++ b/src/cidr.cpp @@ -73,7 +73,11 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr } irc::sockets::sockaddrs addr; - irc::sockets::aptosa(address_copy, 0, addr); + if (!irc::sockets::aptosa(address_copy, 0, addr)) + { + // The address could not be parsed. + return false; + } irc::sockets::cidr_mask mask(cidr_copy); irc::sockets::cidr_mask mask2(addr, mask.length); -- cgit v1.2.3