For consistency with other types, allow empty UINFO RDATA (#424)

Ref https://github.com/miekg/dns/pull/421#discussion_r90610949
This commit is contained in:
Richard Gibson 2016-12-02 17:38:56 -05:00 committed by Miek Gieben
parent 21314e1838
commit f4d2b08694
2 changed files with 6 additions and 4 deletions

View File

@ -2016,9 +2016,12 @@ func setUINFO(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
rr.Hdr = h
s, e, c1 := endingToTxtSlice(c, "bad UINFO Uinfo", f)
if e != nil {
return nil, e, ""
return nil, e, c1
}
rr.Uinfo = s[0] // silently discard anything above
if ln := len(s); ln == 0 {
return rr, nil, c1
}
rr.Uinfo = s[0] // silently discard anything after the first character-string
return rr, nil, c1
}

View File

@ -10,8 +10,7 @@ func TestDynamicUpdateParsing(t *testing.T) {
for _, typ := range TypeToString {
if typ == "OPT" || typ == "AXFR" || typ == "IXFR" || typ == "ANY" || typ == "TKEY" ||
typ == "TSIG" || typ == "ISDN" || typ == "UNSPEC" || typ == "NULL" || typ == "ATMA" ||
typ == "Reserved" || typ == "None" || typ == "NXT" || typ == "MAILB" || typ == "MAILA" ||
typ == "UINFO" {
typ == "Reserved" || typ == "None" || typ == "NXT" || typ == "MAILB" || typ == "MAILA" {
continue
}
r, err := NewRR(prefix + typ)