From bc2101d0db902ef5e9da2cc4c8ac5a63976569a5 Mon Sep 17 00:00:00 2001 From: Flavien Lebarbe Date: Fri, 5 Jun 2015 14:59:53 +0200 Subject: [PATCH] Fix crash in inIxfr when ReadMsg fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- xfr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xfr.go b/xfr.go index 3d2b3e6a..c098925d 100644 --- a/xfr.go +++ b/xfr.go @@ -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 {