mirror of
https://github.com/miekg/dns.git
synced 2025-12-16 09:11:34 +01:00
Make TestDynamicUpdateZeroRdataUnpack pass
Straight up: took a guess and the tests pass.
This commit is contained in:
parent
414013f99f
commit
71436daebe
3
msg.go
3
msg.go
@ -897,6 +897,9 @@ func unpackStructValue(val reflect.Value, msg []byte, off int) (off1 int, err er
|
|||||||
var lenrd int
|
var lenrd int
|
||||||
lenmsg := len(msg)
|
lenmsg := len(msg)
|
||||||
for i := 0; i < val.NumField(); i++ {
|
for i := 0; i < val.NumField(); i++ {
|
||||||
|
if lenrd != 0 && lenrd == off {
|
||||||
|
break
|
||||||
|
}
|
||||||
if off > lenmsg {
|
if off > lenmsg {
|
||||||
return lenmsg, &Error{"bad offset unpacking"}
|
return lenmsg, &Error{"bad offset unpacking"}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user