From 088b281a6a5d12d8006c14ec4df20c4f3a52f3e5 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 11 Oct 2021 21:05:38 +0800 Subject: [PATCH] Fix: #1660 panic --- dns/doh.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dns/doh.go b/dns/doh.go index 3daa7f22..94312355 100644 --- a/dns/doh.go +++ b/dns/doh.go @@ -39,7 +39,9 @@ func (dc *dohClient) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, req = req.WithContext(ctx) msg, err = dc.doRequest(req) - msg.Id = m.Id + if err == nil { + msg.Id = m.Id + } return }