Skip to content
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

Ensures that the cursor's value marker is fully reset between values. #787

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

tgregg
Copy link
Contributor

@tgregg tgregg commented Apr 12, 2024

Description of changes:

Fuzzing identified a case where this mattered. This is now captured in the added unit test. In summary, if the previous value was a struct, and the current value begins with an incomplete annotation wrapper, the reader would attempt to read additional bytes from the input to determine if the value was a symbol table. This could result in ArrayIndexOutOfBoundsException, as in this case, if those bytes are not available. Clearing the typeId between values ensures that the reader will never enter the symbol table determination logic when positioned on an incomplete annotation wrapper, allowing that logic to remain unchanged. After this fix, an IonException for unexpected EOF is thrown in this case.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tgregg tgregg merged commit cccd145 into master Apr 12, 2024
24 of 33 checks passed
@tgregg tgregg deleted the reset-type-id branch April 12, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants