From 8e9a1388b99efecdef9a10479f52a5fcae193f3f Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Tue, 23 Jan 2024 09:42:01 +0100 Subject: [PATCH] dnsname: remove unnecessary cast as suggested by Otto --- pdns/dnsname.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 0c45c96c51..4534788b0d 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -137,8 +137,8 @@ void DNSName::packetParser(const char* qpos, size_t len, size_t offset, bool unc labellen &= (~0xc0); size_t newpos = (labellen << 8) + *(const unsigned char*)pos; - if(newpos < offset) { - if(newpos < static_cast(minOffset)) { + if (newpos < offset) { + if (newpos < minOffset) { throw std::range_error("Invalid label position during decompression ("+std::to_string(newpos)+ " < "+std::to_string(minOffset)+")"); } if (++depth > 100) { -- 2.47.2