Fix crash in inIxfr when ReadMsg fails

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x5dc851]

goroutine 41 [running]:
github.com/miekg/dns.(*Transfer).inIxfr(0xc2127648d0, 0x437bcc, 0xc21678c600)
        /mnt/data/xxxxx/third-party/src/github.com/miekg/dns/xfr.go:110 +0x231
created by github.com/miekg/dns.func·073
        /mnt/data/xxxxx/third-party/src/github.com/miekg/dns/xfr.go:45 +0xf5
This commit is contained in:
Flavien Lebarbe 2015-06-05 14:59:53 +02:00
parent bb1103f648
commit bc2101d0db
1 changed files with 1 additions and 1 deletions

2
xfr.go
View File

@ -107,7 +107,7 @@ func (t *Transfer) inIxfr(id uint16, c chan *Envelope) {
t.SetReadDeadline(time.Now().Add(timeout))
in, err := t.ReadMsg()
if err != nil {
c <- &Envelope{in.Answer, err}
c <- &Envelope{nil, err}
return
}
if id != in.Id {