If DNSName::packetParser() is called with offset >= len,
we do pos = qpos + offset, then labellen=*pos++ before
checking that pos is not after qpos + len, leading to
a potential out-of-bound read.
const unsigned char* pos=(const unsigned char*)qpos;
unsigned char labellen;
const unsigned char *opos = pos;
+
+ if (offset >= len)
+ throw std::range_error("Trying to read past the end of the buffer");
+
pos += offset;
const unsigned char* end = pos + len;
while((labellen=*pos++) && pos < end) { // "scan and copy"