mirror of
https://github.com/coredns/coredns.git
synced 2026-07-10 17:50:12 -04:00
plugin/pkg/dnsutil: guard Join against an empty label slice (#8225)
This commit is contained in:
committed by
GitHub
parent
7abc21bc49
commit
9226f8a3aa
@@ -19,3 +19,12 @@ func TestJoin(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestJoinEmpty(t *testing.T) {
|
||||
// Join called with no labels must not index labels[ll-1] out of range; it
|
||||
// returns the root name. Callers on the MX/SRV path can reach Join with an
|
||||
// empty label slice.
|
||||
if x := Join(); x != "." {
|
||||
t.Errorf("expected %q, got %q", ".", x)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user