mirror of
https://github.com/miekg/dns.git
synced 2025-10-15 03:41:00 +02:00
More TXT related fixes
Add two corner cases for testing
This commit is contained in:
parent
6470b8335d
commit
37ef7bd219
2
msg.go
2
msg.go
@ -650,7 +650,7 @@ func unpackStructValue(val reflect.Value, msg []byte, off int) (off1 int, ok boo
|
|||||||
println("dns: failure unpacking txt strings")
|
println("dns: failure unpacking txt strings")
|
||||||
return lenmsg, false
|
return lenmsg, false
|
||||||
}
|
}
|
||||||
txt = append(txt, string(msg[off+1:off+l]))
|
txt = append(txt, string(msg[off+1:off+l+1]))
|
||||||
off += l+1
|
off += l+1
|
||||||
if off < rdlength {
|
if off < rdlength {
|
||||||
// More
|
// More
|
||||||
|
@ -202,6 +202,8 @@ func TestQuotes(t *testing.T) {
|
|||||||
`t.example.com. IN TXT "a bc"`: "t.example.com.\t3600\tIN\tTXT\t\"a bc\"",
|
`t.example.com. IN TXT "a bc"`: "t.example.com.\t3600\tIN\tTXT\t\"a bc\"",
|
||||||
`t.example.com. IN TXT "a
|
`t.example.com. IN TXT "a
|
||||||
bc"`: "t.example.com.\t3600\tIN\tTXT\t\"a\n bc\"",
|
bc"`: "t.example.com.\t3600\tIN\tTXT\t\"a\n bc\"",
|
||||||
|
`t.example.com. IN TXT "a"`: "t.example.com.\t3600\tIN\tTXT\t\"a\"",
|
||||||
|
`t.example.com. IN TXT "aa"`: "t.example.com.\t3600\tIN\tTXT\t\"aa\"",
|
||||||
`t.example.com. IN TXT "aaa" ;`: "t.example.com.\t3600\tIN\tTXT\t\"aaa\"",
|
`t.example.com. IN TXT "aaa" ;`: "t.example.com.\t3600\tIN\tTXT\t\"aaa\"",
|
||||||
`t.example.com. IN TXT "abc" "DEF"`: "t.example.com.\t3600\tIN\tTXT\t\"abc\" \"DEF\"",
|
`t.example.com. IN TXT "abc" "DEF"`: "t.example.com.\t3600\tIN\tTXT\t\"abc\" \"DEF\"",
|
||||||
`t.example.com. IN TXT "abc" ( "DEF" )`: "t.example.com.\t3600\tIN\tTXT\t\"abc\" \"DEF\"",
|
`t.example.com. IN TXT "abc" ( "DEF" )`: "t.example.com.\t3600\tIN\tTXT\t\"abc\" \"DEF\"",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user