diff options
author | Peter Powell <petpow@saberuk.com> | 2019-02-18 15:43:22 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-02-18 15:48:26 +0000 |
commit | 8bc996bcc1444b33ccfde6ca3588deee0a0459d1 (patch) | |
tree | 9abcaa015c022e502dec43733a9a4be7e8a6df3e /src | |
parent | 755a32c75101c4df0e5699db558785fc0dbc1973 (diff) |
Fix MatchCIDR matching UNIX socket hostnames.
Diffstat (limited to 'src')
-rw-r--r-- | src/cidr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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); |