vm: restrict map key size
This commit is contained in:
parent
1f9b92c295
commit
543fd58e93
5 changed files with 20 additions and 11 deletions
|
@ -360,8 +360,8 @@ func FromJSONWithTypes(data []byte) (Item, error) {
|
|||
key, err := FromJSONWithTypes(arr[i].Key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !IsValidMapKey(key) {
|
||||
return nil, fmt.Errorf("invalid map key of type %s", key.Type())
|
||||
} else if err = IsValidMapKey(key); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
value, err := FromJSONWithTypes(arr[i].Value)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue