dns: add length check to avoid panic

This commit is contained in:
nadoo committed 2020-05-05 01:30:57 +08:00
1 parent 665d722d2c
commit e3c57ba369
6 files changed
+20 -55

No files matched your search

+1 -1
View File
@@ -89,7 +89,7 @@ func (d *Direct) dial(network, addr string, localIP net.IP) (net.Conn, error) {
c.SetKeepAlive(true)
}
if d.relayTimeout != 0 {
if d.relayTimeout > 0 {
c.SetDeadline(time.Now().Add(d.relayTimeout))
}