1
0
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:
Frank Denis 2021-06-06 01:05:14 +02:00
parent 1cdb71cd7c
commit 92792f0e8b

View File

@ -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")