Commit e643dc79 authored by Tarmigan Casebolt's avatar Tarmigan Casebolt Committed by Minux Ma

net: check 'ok' return in dnsmsg when initially packing rr.Header()

In the present code, there is no way for ok to ever return false, but
it still a good idea to check it.

Change-Id: I8f360018b33a5d85dabbbbec0f89ffc81f77ecbb
Reviewed-on: https://go-review.googlesource.com/13956Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9172a1b5
......@@ -691,6 +691,9 @@ func packRR(rr dnsRR, msg []byte, off int) (off2 int, ok bool) {
// off1 is end of header
// off2 is end of rr
off1, ok = packStruct(rr.Header(), msg, off)
if !ok {
return len(msg), false
}
off2, ok = packStruct(rr, msg, off)
if !ok {
return len(msg), false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment