Logo
Explore Help
Sign In
Mirrors/coredns
1
0
Fork 0
You've already forked coredns
mirror of https://github.com/coredns/coredns.git synced 2025-10-27 16:24:19 -04:00
Code Issues Packages Projects Releases Wiki Activity
Files
bdec0a294b4aa6618572bec98daf340408f69409
coredns/test/corefile_test.go

18 lines
273 B
Go
Raw Normal View History

Fix obsure crash in Corefile parsing (#4637) This was found by fuzzing. We need to make this a fully qualified domain name to catch all errors in dnsserver/register.go and not later when plugin.Normalize() is called again on these strings, with the prime difference being that the domain name is fully qualified. This was found by fuzzing where "ȶ" is deemed OK, but "ȶ." is not (might be a bug in miekg/dns actually). But here we were checking ȶ, which is OK, and later we barf in ȶ. leading to "index out of range". Added a tests and check manually if it would crash with the current code (yes), and fail with an error in this PR (yes). Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-19 19:38:37 +02:00
package test
import (
"testing"
)
func TestCorefile1(t *testing.T) {
corefile := `ȶ
acl
`
// this crashed, now it should return an error.
i, _, _, err := CoreDNSServerAndPorts(corefile)
if err == nil {
defer i.Stop()
t.Fatalf("Expected an error got none")
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.7 Page: 35ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API