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
@@ -10,6 +10,9 @@ import (
|
||||
// the root label it is ignored. Not other syntax checks are performed.
|
||||
func Join(labels ...string) string {
|
||||
ll := len(labels)
|
||||
if ll == 0 {
|
||||
return "."
|
||||
}
|
||||
if labels[ll-1] == "." {
|
||||
return strings.Join(labels[:ll-1], ".") + "."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user