Make TestDynamicUpdateZeroRdataUnpack pass

Straight up: took a guess and the tests pass.
This commit is contained in:
Andrew Tunnell-Jones 2014-11-12 07:56:21 +00:00
parent 414013f99f
commit 71436daebe
1 changed files with 3 additions and 0 deletions

3
msg.go
View File

@ -897,6 +897,9 @@ func unpackStructValue(val reflect.Value, msg []byte, off int) (off1 int, err er
var lenrd int
lenmsg := len(msg)
for i := 0; i < val.NumField(); i++ {
if lenrd != 0 && lenrd == off {
break
}
if off > lenmsg {
return lenmsg, &Error{"bad offset unpacking"}
}