And check err here as well.

This commit is contained in:
Miek Gieben 2015-08-07 16:56:49 +01:00
parent 3861fcbbb2
commit d7ca9f827c
2 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ func TestFuzzString(t *testing.T) {
";a ", ";a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
" NSAP O ", " NSAP N ",
" TYPE4 TYPE6a789a3bc0045c8a5fb42c7d1bd998f5444 IN 9579b47d46817afbd17273e6",
" TYPE45 3 3 4147994 TYPE\\(\\)\\)\\(\\)\\(\\(\\)\\(\\)\\)\\)\\(\\)\\(\\)\\(\\(\\R 948\"\")\\(\\)\\)\\)\\(\\ ",
}
for i, tc := range testcases {
rr, err := NewRR(tc)

View File

@ -2168,7 +2168,7 @@ func setIPSECKEY(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string)
rr.GatewayName = o
}
_, ok := IsDomainName(l.token)
if !ok || l.length == 0 {
if !ok || l.length == 0 || l.err {
return nil, &ParseError{f, "bad IPSECKEY GatewayName", l}, ""
}
if rr.GatewayName[l.length-1] != '.' {