mirror of
https://github.com/DNSCrypt/doh-server.git
synced 2025-04-05 05:57:38 +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,
|
label_len => label_len,
|
||||||
} as usize;
|
} as usize;
|
||||||
|
ensure!(label_len < 0x40, "Long label");
|
||||||
ensure!(
|
ensure!(
|
||||||
packet_len - offset - 1 > label_len,
|
packet_len - offset - 1 > label_len,
|
||||||
"Malformed packet with an out-of-bounds name"
|
"Malformed packet with an out-of-bounds name"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue