From e1d33e34832967673563051eccc0cbb95f70a9ec Mon Sep 17 00:00:00 2001 From: Jasper Insinger Date: Tue, 13 Aug 2024 22:20:55 +0200 Subject: [PATCH] src/dns_packet: Ignore spaces in unquoted DNS values --- src/dns_packet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dns_packet.cpp b/src/dns_packet.cpp index e2525e2..915b78c 100644 --- a/src/dns_packet.cpp +++ b/src/dns_packet.cpp @@ -77,10 +77,10 @@ inline tl::expected AdvanceReader(std::span '~'; + result |= c < '!' || c > '~'; } return result; @@ -160,7 +160,7 @@ tl::expected ReadFromDNSNameFormat(std::span ParseResourceRecord(std::span(rdata_bytes, reader, tag_length)); - if (contains_unprintable_chars(std::string_view(r_data.tag))) [[unlikely]] + if (contains_unprintable_chars_or_space(std::string_view(r_data.tag))) [[unlikely]] return tl::unexpected(DNSParseError::InvalidChar); uint16_t value_len = rdata_bytes.end() - reader;