Skip to content

Commit

Permalink
allow referencing of compressed label directly before another compres…
Browse files Browse the repository at this point in the history
…sed label, thanks @giganteous
  • Loading branch information
Peter van Dijk committed Apr 21, 2015
1 parent 27e830b commit 64425b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdns/dnsparser.cc
Expand Up @@ -471,7 +471,7 @@ void PacketReader::getLabelFromContent(const vector<uint8_t>& content, uint16_t&
uint16_t offset=256*(labellen & ~0xc0) + (unsigned int)content.at(frompos++) - sizeof(dnsheader);
// cout<<"This is an offset, need to go to: "<<offset<<endl;

if(offset >= pos-2)
if(offset >= pos)
throw MOADNSException("forward reference during label decompression");
return getLabelFromContent(content, offset, ret, ++recurs);
}
Expand Down

0 comments on commit 64425b9

Please sign in to comment.