Skip to content

Commit

Permalink
dnsutil: extractMDNSService out-of-bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Oct 4, 2023
1 parent 0875e82 commit 9486a0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion intra/xdns/dnsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ func extractMDNSDomain(qname string) (svc, tld string) {
tldarpa4 := strings.LastIndex(qname, arpa4suffix)
tldarpa6 := strings.LastIndex(qname, arpa6suffix)
tldlocal := strings.LastIndex(qname, localsuffix)
if tldlocal == len(qname)-len(localsuffix) {
if tldlocal > 0 && tldlocal == len(qname)-len(localsuffix) {
svc = qname[:tldlocal-1] // remove trailing dot; example. -> example
tld = localsuffix
} else if tldarpa4 > 0 {
Expand Down

0 comments on commit 9486a0f

Please sign in to comment.