Commit c22d44f1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0080c71f
...@@ -392,8 +392,11 @@ func TestMsgMarshalAllOverflowLightly(t *testing.T) { ...@@ -392,8 +392,11 @@ func TestMsgMarshalAllOverflowLightly(t *testing.T) {
} }
} }
// Verify overflow handling on decode len checks // Verify overflow handling on decodeN len checks
func TestMsgDecodeLenOverflow(t *testing.T) { // TODO + M-variants with big len too?
func TestMsgDecodeLenOverflowN(t *testing.T) {
enc := Encoding('N')
var testv = []struct { var testv = []struct {
msg Msg // of type to decode into msg Msg // of type to decode into
data string // []byte - tricky data to exercise decoder u32 len checks overflow data string // []byte - tricky data to exercise decoder u32 len checks overflow
...@@ -405,8 +408,6 @@ func TestMsgDecodeLenOverflow(t *testing.T) { ...@@ -405,8 +408,6 @@ func TestMsgDecodeLenOverflow(t *testing.T) {
{&AnswerLockedTransactions{}, u32(0x10000000)}, {&AnswerLockedTransactions{}, u32(0x10000000)},
} }
enc := Encoding('N') // XXX hardcoded XXX + M-variants with big len?
for _, tt := range testv { for _, tt := range testv {
data := []byte(tt.data) data := []byte(tt.data)
func() { func() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment