diff -ru dnsdist-2.0.2.orig/dnsparser.hh dnsdist-2.0.2-347/dnsparser.hh --- dnsdist-2.0.2.orig/dnsparser.hh 2025-12-01 13:21:08.000000000 +0100 +++ dnsdist-2.0.2-347/dnsparser.hh 2026-03-13 15:13:46.665375672 +0100 @@ -177,6 +177,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; }