mirror of
https://github.com/DNSCrypt/doh-server.git
synced 2025-04-03 21:17:36 +03:00
Refuse long labels
This commit is contained in:
parent
4e4ddcf8e5
commit
31953b2605
1 changed files with 1 additions and 0 deletions
|
@ -63,6 +63,7 @@ fn skip_name(packet: &[u8], offset: usize) -> Result<usize, Error> {
|
|||
}
|
||||
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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue