net: netgo resolver cannot lookup 254 characters FQDN #54285
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Lookup for 254 characters FQDN, maximum length as per the DNS spec.
https://go.dev/play/p/QMYRUTEvL2Y
In the above play I use
LookupTXT
, but other Lookup* functions are also affected by this bug when built with-tags netgo
.What did you expect to see?
Successful response or NXDOMAIN
What did you see instead?
In dnsclient_unix.go,
*dnsConfig.nameList
rejects 254 characters FQDN instead of rejecting 254 characters non-FQDN.go/src/net/dnsclient_unix.go
Lines 484 to 485 in 4345620
It also means
*dnsConfig.nameList
accepts 254 characters non-FQDN and generates invalid 255 characters FQDN.go/src/net/dnsclient_unix.go
Lines 495 to 503 in 4345620
On the other hand,
isDomainName
does correct FQDN handling.go/src/net/dnsclient.go
Line 90 in 4345620
The text was updated successfully, but these errors were encountered: