Skip to content

Commit c727daf

Browse files
committed
xdns: nilaway
1 parent bc592f9 commit c727daf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

intra/xdns/dnsutil.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ func HasTCFlag(packet []byte) bool {
122122
}
123123

124124
func QName(msg *dns.Msg) string {
125-
if HasAnyQuestion(msg) {
126-
return msg.Question[0].Name
125+
if !HasAnyQuestion(msg) {
126+
return ""
127127
}
128-
return ""
128+
q := msg.Question[0]
129+
return q.Name
129130
}
130131

131132
func AName(ans dns.RR) (string, error) {

0 commit comments

Comments
 (0)