-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array/map not checked when inlined into enum #175
Comments
rooooooooob
added a commit
that referenced
this issue
Dec 12, 2023
Fixes #175 Now properly checks all lengths for all variants to ensure that overlapping types parse the correct variant instead of prematurely thinking it's a subset of one. Also fixes having CBORReadLen contributions from previous variants that tried to parse from contributing to later variant parses (possibly causing issues if it meant it already hit the limit). Includes support for optional fields within enums that get inlined. Tests for both cases.
SebastienGllmt
pushed a commit
that referenced
this issue
Dec 15, 2023
* Enum length-check fixes + Enum optional field support Fixes #175 Now properly checks all lengths for all variants to ensure that overlapping types parse the correct variant instead of prematurely thinking it's a subset of one. Also fixes having CBORReadLen contributions from previous variants that tried to parse from contributing to later variant parses (possibly causing issues if it meant it already hit the limit). Includes support for optional fields within enums that get inlined. Tests for both cases. * preserve-encodings tests for overlapping_inlined + enum_opt_embed_fields
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will not work as some variants are subsets of other ones so will incorrectly parse as one of the other variants without checking the array/map length here.
When you do this not inlined like:
there is no problem as this is taken care of in the dedicated structs' deserializes.
The text was updated successfully, but these errors were encountered: