You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have been doing some testing with asn1tools, and ran into an odd bug. It appears that if you define a SEQUENCE OF field which is fixed length and greater than 255, the generated OER C decoder cannot decode the field. Example:
MyMessage SEQUENCE ::= {
someArray SEQUENCE (SIZE(512)) OF Int8
}
If I generate an oer decoder for that, the C code ends up with something like this:
Since the size of the sequence, 512, does not fit in one byte, number_of_length_bytes_1 ends up as 2. So, decoding fails.
I apologize if I've just missed something and this is expected behavior, but it seems like a potential issue (especially since the encoder doesn't complain about the length at all). So, I figured I'd report it. For the time being, we worked around the issue by using variable length sequences (e.g. someArray SEQUENCE (SIZE(0..512)) OF Int8), which do not seem to have this issue.
The text was updated successfully, but these errors were encountered:
We have been doing some testing with asn1tools, and ran into an odd bug. It appears that if you define a SEQUENCE OF field which is fixed length and greater than 255, the generated OER C decoder cannot decode the field. Example:
If I generate an oer decoder for that, the C code ends up with something like this:
Since the size of the sequence, 512, does not fit in one byte,
number_of_length_bytes_1
ends up as 2. So, decoding fails.I apologize if I've just missed something and this is expected behavior, but it seems like a potential issue (especially since the encoder doesn't complain about the length at all). So, I figured I'd report it. For the time being, we worked around the issue by using variable length sequences (e.g.
someArray SEQUENCE (SIZE(0..512)) OF Int8
), which do not seem to have this issue.The text was updated successfully, but these errors were encountered: