forked from TrueCloudLab/neoneo-go
stackitem: properly pass allowInvalid on binary deserialization
Otherwise DecodeBinaryProtected() is broken for arrays/maps.
This commit is contained in:
parent
3a991abb62
commit
654c4a6589
1 changed files with 3 additions and 3 deletions
|
@ -212,7 +212,7 @@ func decodeBinary(r *io.BinReader, allowInvalid bool) Item {
|
||||||
size := int(r.ReadVarUint())
|
size := int(r.ReadVarUint())
|
||||||
arr := make([]Item, size)
|
arr := make([]Item, size)
|
||||||
for i := 0; i < size; i++ {
|
for i := 0; i < size; i++ {
|
||||||
arr[i] = DecodeBinary(r)
|
arr[i] = decodeBinary(r, allowInvalid)
|
||||||
}
|
}
|
||||||
|
|
||||||
if t == ArrayT {
|
if t == ArrayT {
|
||||||
|
@ -223,8 +223,8 @@ func decodeBinary(r *io.BinReader, allowInvalid bool) Item {
|
||||||
size := int(r.ReadVarUint())
|
size := int(r.ReadVarUint())
|
||||||
m := NewMap()
|
m := NewMap()
|
||||||
for i := 0; i < size; i++ {
|
for i := 0; i < size; i++ {
|
||||||
key := DecodeBinary(r)
|
key := decodeBinary(r, allowInvalid)
|
||||||
value := DecodeBinary(r)
|
value := decodeBinary(r, allowInvalid)
|
||||||
if r.Err != nil {
|
if r.Err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue