Skip to content

Commit b2410d0

Browse files
committed
ODoH bounds check
1 parent 048a7b8 commit b2410d0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

dnscrypt-proxy/oblivious_doh.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ func parseODoHTargetConfigs(configs []byte) ([]ODoHTargetConfig, error) {
7979
}
8080
configVersion := binary.BigEndian.Uint16(configs[offset : offset+2])
8181
configLength := binary.BigEndian.Uint16(configs[offset+2 : offset+4])
82+
if offset+4+int(configLength) > len(configs) {
83+
break
84+
}
8285
if configVersion == odohVersion || configVersion == odohTestVersion {
8386
if configVersion != odohVersion {
8487
dlog.Debugf("Server still uses the legacy 0x%x ODoH version", configVersion)

0 commit comments

Comments
 (0)