Skip to content

Commit 45c614a

Browse files
authored
Merge pull request #1124 from ghostcloud-cn/bugdns
check fields len in dns.go
2 parents 854da22 + 03a6ffd commit 45c614a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/pkg/net/dns/dns.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func GetSystemNameServers() ([]net.IP, error) {
4242
continue
4343
}
4444
fields := strings.Fields(trimmed)
45-
if len(fields) == 0 {
45+
if len(fields) < 2 {
4646
continue
4747
}
4848
if fields[0] == "nameserver" {

0 commit comments

Comments
 (0)