diff --git a/src/dns.rs b/src/dns.rs index 4d86a65..d6401ac 100644 --- a/src/dns.rs +++ b/src/dns.rs @@ -63,6 +63,7 @@ fn skip_name(packet: &[u8], offset: usize) -> Result { } label_len => label_len, } as usize; + ensure!(label_len < 0x40, "Long label"); ensure!( packet_len - offset - 1 > label_len, "Malformed packet with an out-of-bounds name"