mirror of
https://github.com/miekg/dns.git
synced 2025-12-16 09:11:34 +01:00
Fix HIP parsing
This commit is contained in:
parent
1897a2a983
commit
3861fcbbb2
@ -7,16 +7,15 @@ func TestFuzzString(t *testing.T) {
|
|||||||
";a ", ";a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
";a ", ";a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
||||||
" NSAP O ", " NSAP N ",
|
" NSAP O ", " NSAP N ",
|
||||||
" TYPE4 TYPE6a789a3bc0045c8a5fb42c7d1bd998f5444 IN 9579b47d46817afbd17273e6",
|
" TYPE4 TYPE6a789a3bc0045c8a5fb42c7d1bd998f5444 IN 9579b47d46817afbd17273e6",
|
||||||
// " HIP 0 e e @ . .",
|
|
||||||
}
|
}
|
||||||
for i, tc := range testcases {
|
for i, tc := range testcases {
|
||||||
rr, err := NewRR(tc)
|
rr, err := NewRR(tc)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// rr can still be nil because we can (for instance) just parse a comment
|
// rr can be nil because we can (for instance) just parse a comment
|
||||||
if rr == nil {
|
if rr == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
t.Fatalf("parsed mailformed RR %d: %s", i, rr.String)
|
t.Fatalf("parsed mailformed RR %d: %s", i, rr.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1054,6 +1054,7 @@ func setHIP(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
|
|||||||
case zString:
|
case zString:
|
||||||
if l.token == "@" {
|
if l.token == "@" {
|
||||||
xs = append(xs, o)
|
xs = append(xs, o)
|
||||||
|
l = <-c
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
_, ok := IsDomainName(l.token)
|
_, ok := IsDomainName(l.token)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user