mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 14:18:47 +00:00
encoding/cbor: fix umarshal of big fixed arrays
This commit is contained in:
@@ -520,9 +520,7 @@ _unmarshal_array :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header
|
|||||||
return
|
return
|
||||||
|
|
||||||
case reflect.Type_Info_Array:
|
case reflect.Type_Info_Array:
|
||||||
_, scap := err_conv(_decode_len_container(d, add)) or_return
|
length, _ := err_conv(_decode_len_container(d, add)) or_return
|
||||||
length := min(scap, t.count)
|
|
||||||
|
|
||||||
if length > t.count {
|
if length > t.count {
|
||||||
return _unsupported(v, hdr)
|
return _unsupported(v, hdr)
|
||||||
}
|
}
|
||||||
@@ -534,9 +532,7 @@ _unmarshal_array :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header
|
|||||||
return
|
return
|
||||||
|
|
||||||
case reflect.Type_Info_Enumerated_Array:
|
case reflect.Type_Info_Enumerated_Array:
|
||||||
_, scap := err_conv(_decode_len_container(d, add)) or_return
|
length, _ := err_conv(_decode_len_container(d, add)) or_return
|
||||||
length := min(scap, t.count)
|
|
||||||
|
|
||||||
if length > t.count {
|
if length > t.count {
|
||||||
return _unsupported(v, hdr)
|
return _unsupported(v, hdr)
|
||||||
}
|
}
|
||||||
@@ -548,9 +544,7 @@ _unmarshal_array :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header
|
|||||||
return
|
return
|
||||||
|
|
||||||
case reflect.Type_Info_Complex:
|
case reflect.Type_Info_Complex:
|
||||||
_, scap := err_conv(_decode_len_container(d, add)) or_return
|
length, _ := err_conv(_decode_len_container(d, add)) or_return
|
||||||
length := min(scap, 2)
|
|
||||||
|
|
||||||
if length > 2 {
|
if length > 2 {
|
||||||
return _unsupported(v, hdr)
|
return _unsupported(v, hdr)
|
||||||
}
|
}
|
||||||
@@ -570,9 +564,7 @@ _unmarshal_array :: proc(d: Decoder, v: any, ti: ^reflect.Type_Info, hdr: Header
|
|||||||
return
|
return
|
||||||
|
|
||||||
case reflect.Type_Info_Quaternion:
|
case reflect.Type_Info_Quaternion:
|
||||||
_, scap := err_conv(_decode_len_container(d, add)) or_return
|
length, _ := err_conv(_decode_len_container(d, add)) or_return
|
||||||
length := min(scap, 4)
|
|
||||||
|
|
||||||
if length > 4 {
|
if length > 4 {
|
||||||
return _unsupported(v, hdr)
|
return _unsupported(v, hdr)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user