Closed gniemirowski closed 2 years ago
Thanks, @gniemirowski
This commit is actually wrong. It doesn't fix the case, but it breaks the corner cases. It should be reverted!
Section 4 of X.691 defines 64K as 65536, and Section 11.5.7 explicitly states
c) "range" is greater than 256 and less than or equal to 64K (the two-octet case).
So after this commit, you changing from less-than-or-equal 65536 to less-than 65536, resulting in all non-negative whole numbers with a range of 65536 to be encoded the wrong way (more than two octets)
Related PR containing fixes: https://github.com/mouse07410/asn1c/pull/93
@laf0rge This commit was about length and not non-negative whole numbers in general. Small lenghts with large ranges (>=64K) should be encoded in single byte. #93 breaks it again.
First, it would be easier to track if this discussion was happening in a new issue, rather than in a merged and closed PR. Would one of you like to open a new issue, or should I do that?
I created this ticket to follow up on this issue: https://github.com/mouse07410/asn1c/issues/94
Fix for issue #62 Based on https://github.com/open5gs/open5gs/commit/f47f65a51cae51c0c1b5c2268f2f2f52b162913b