diff -ru dnsdist-1.9.11.orig/dnsparser.hh dnsdist-1.9.11-347/dnsparser.hh --- dnsdist-1.9.11.orig/dnsparser.hh 2025-09-18 09:10:23.000000000 +0200 +++ dnsdist-1.9.11-347/dnsparser.hh 2026-03-13 15:11:59.658674070 +0100 @@ -176,6 +176,11 @@ void skip(uint16_t n) { + size_t stop = d_pos; + stop += n; + if (stop > d_content.size()) { + throw std::out_of_range("Attempt to skip bytes (" + std::to_string(n) + " starting at " + std::to_string(d_pos) + ") farther than the packet's end (" + std::to_string(d_content.size()) + ")"); + } d_pos += n; }