Add Test for dynamic unpack failure

This commit is contained in:
Miek Gieben 2014-11-09 10:04:46 +00:00
parent 20e762df62
commit 7619917e11
1 changed files with 10 additions and 0 deletions

View File

@ -21,3 +21,13 @@ func TestDynamicUpdateParsing(t *testing.T) {
}
}
func TestDynamicUpdateUnpack(t *testing.T) {
// From https://github.com/miekg/dns/issues/150#issuecomment-62296803
buf := []byte{171, 68, 40, 0, 0, 1, 0, 0, 0, 2, 0, 0, 7, 101, 120, 97, 109, 112, 108, 101, 0, 0, 6, 0, 1, 192, 12, 0, 1, 0, 255, 0, 0, 0, 0, 0, 0, 192, 12, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 127, 0, 0, 1}
msg := new(Msg)
err := msg.Unpack(buf)
if err != nil {
t.Log("failed to unpack: " + err.Error())
// t.Fail()
}
}