mirror of
https://github.com/miekg/dns.git
synced 2025-10-11 09:51:01 +02:00
Fix overflow when the buffer is really small
This commit is contained in:
parent
402ce277df
commit
b639fa305d
6
msg.go
6
msg.go
@ -806,7 +806,11 @@ func unpackStructValue(val reflect.Value, msg []byte, off int) (off1 int, ok boo
|
|||||||
// Work because of rfc4034, section 3.17
|
// Work because of rfc4034, section 3.17
|
||||||
consumed += len(val.FieldByName("SignerName").String()) + 1
|
consumed += len(val.FieldByName("SignerName").String()) + 1
|
||||||
default:
|
default:
|
||||||
consumed = 0 // TODO
|
consumed = 0 // TODO, maybe error?
|
||||||
|
}
|
||||||
|
if off+rdlength-consumed > lenmsg {
|
||||||
|
println("dns: failure unpacking base64")
|
||||||
|
return lenmsg, false
|
||||||
}
|
}
|
||||||
s = unpackBase64(msg[off : off+rdlength-consumed])
|
s = unpackBase64(msg[off : off+rdlength-consumed])
|
||||||
off += rdlength - consumed
|
off += rdlength - consumed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user