From: Charles-Henri Bruyand Date: Tue, 23 Jan 2024 08:42:01 +0000 (+0100) Subject: dnsname: remove unnecessary cast as suggested by Otto X-Git-Tag: dnsdist-1.9.0-rc1~14^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13723%2Fhead;p=thirdparty%2Fpdns.git dnsname: remove unnecessary cast as suggested by Otto --- 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) {