From 49b9c6bcb9746469c00619f6fe1d444326d42b60 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 29 Jun 2018 11:29:08 +0100 Subject: Switch core_dns validation to use InspIRCd::IsHost. --- src/coremods/core_dns.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp index ea234861a..4caea9c48 100644 --- a/src/coremods/core_dns.cpp +++ b/src/coremods/core_dns.cpp @@ -40,11 +40,6 @@ using namespace DNS; */ class Packet : public Query { - static bool IsValidName(const std::string& name) - { - return (name.find_first_not_of("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-") == std::string::npos); - } - void PackName(unsigned char* output, unsigned short output_size, unsigned short& pos, const std::string& name) { if (pos + name.length() + 2 > output_size) @@ -195,7 +190,7 @@ class Packet : public Query case QUERY_PTR: { record.rdata = this->UnpackName(input, input_size, pos); - if (!IsValidName(record.rdata)) + if (!InspIRCd::IsHost(record.rdata)) throw Exception("Invalid name"); // XXX: Causes the request to time out break; -- cgit v1.2.3