Skip to content

Commit f9d5095

Browse files
shawndxneild
authored andcommitted
net: fix failure of TestCVE202133195
TestCVE202133195 fails in testing LookupSRV if /etc/resolv.conf sets the option 'ndots' larger than the number of dots in the domain name under query. Fix the issue by making the input domain name in test codes 'rooted' to skip search list qualifying. Fixes #46955 Change-Id: I1909fa7e54e9c9af57623e57cafc905729ff99fa Reviewed-on: https://go-review.googlesource.com/c/go/+/330842 Reviewed-by: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org>
1 parent e294b8a commit f9d5095

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/net/dnsclient_unix_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,12 +1921,12 @@ func TestCVE202133195(t *testing.T) {
19211921
t.Errorf("LookupSRV returned unexpected error, got %q, want %q", err, expected)
19221922
}
19231923

1924-
_, _, err = r.LookupSRV(context.Background(), "hdr", "tcp", "golang.org")
1925-
if expected := "lookup golang.org: SRV header name is invalid"; err == nil || err.Error() != expected {
1924+
_, _, err = r.LookupSRV(context.Background(), "hdr", "tcp", "golang.org.")
1925+
if expected := "lookup golang.org.: SRV header name is invalid"; err == nil || err.Error() != expected {
19261926
t.Errorf("Resolver.LookupSRV returned unexpected error, got %q, want %q", err, expected)
19271927
}
1928-
_, _, err = LookupSRV("hdr", "tcp", "golang.org")
1929-
if expected := "lookup golang.org: SRV header name is invalid"; err == nil || err.Error() != expected {
1928+
_, _, err = LookupSRV("hdr", "tcp", "golang.org.")
1929+
if expected := "lookup golang.org.: SRV header name is invalid"; err == nil || err.Error() != expected {
19301930
t.Errorf("LookupSRV returned unexpected error, got %q, want %q", err, expected)
19311931
}
19321932

0 commit comments

Comments
 (0)