Skip to content

Commit

Permalink
fix(pkg/nameserver): ignore empty lines in /etc/resolv.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 31, 2024
1 parent 482d1ba commit 6233499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/nameserver/getlocal_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func getLocalNameservers(filename string) (nameservers []netip.AddrPort) {
continue
}
fields := strings.Fields(line)
if fields[0] != "nameserver" {
if len(fields) == 0 || fields[0] != "nameserver" {
continue
}
for _, field := range fields[1:] {
Expand Down

0 comments on commit 6233499

Please sign in to comment.