mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-01-06 01:37:12 +01:00
Prevent remotely triggerable crash in ODoH config parser
This commit is contained in:
parent
1cdb71cd7c
commit
92792f0e8b
@ -63,6 +63,9 @@ func parseODoHTargetConfig(config []byte) (ODoHTargetConfig, error) {
|
||||
}
|
||||
|
||||
func parseODoHTargetConfigs(configs []byte) ([]ODoHTargetConfig, error) {
|
||||
if len(configs) <= 2 {
|
||||
return nil, fmt.Errorf("No configs")
|
||||
}
|
||||
length := binary.BigEndian.Uint16(configs)
|
||||
if len(configs) != int(length)+2 {
|
||||
return nil, fmt.Errorf("Malformed configs")
|
||||
|
Loading…
Reference in New Issue
Block a user