diff options
| author | 2024-04-22 09:11:53 +0000 | |
|---|---|---|
| committer | 2024-04-22 09:11:53 +0000 | |
| commit | a57dd15a8edbe609f06676d80193cec0ffce8800 (patch) | |
| tree | 0dc8d46050af6d819dfc5af06ec8353eced5d052 /vendor/github.com/miekg/dns/defaults.go | |
| parent | [chore] bump modernc.org/sqlite to v1.29.8 (with our concurrency workaround) ... (diff) | |
| download | gotosocial-a57dd15a8edbe609f06676d80193cec0ffce8800.tar.xz | |
[chore]: Bump github.com/miekg/dns from 1.1.58 to 1.1.59 (#2861)
Diffstat (limited to 'vendor/github.com/miekg/dns/defaults.go')
| -rw-r--r-- | vendor/github.com/miekg/dns/defaults.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/github.com/miekg/dns/defaults.go b/vendor/github.com/miekg/dns/defaults.go index 02d9199a4..68e766c68 100644 --- a/vendor/github.com/miekg/dns/defaults.go +++ b/vendor/github.com/miekg/dns/defaults.go @@ -198,10 +198,12 @@ func IsDomainName(s string) (labels int, ok bool) { off int begin int wasDot bool + escape bool ) for i := 0; i < len(s); i++ { switch s[i] { case '\\': + escape = !escape if off+1 > lenmsg { return labels, false } @@ -217,6 +219,7 @@ func IsDomainName(s string) (labels int, ok bool) { wasDot = false case '.': + escape = false if i == 0 && len(s) > 1 { // leading dots are not legal except for the root zone return labels, false @@ -243,10 +246,13 @@ func IsDomainName(s string) (labels int, ok bool) { labels++ begin = i + 1 default: + escape = false wasDot = false } } - + if escape { + return labels, false + } return labels, true } |
