Skip to content

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

Merged
tgregg merged 1 commit intomasterfrom
reset-type-id
Apr 12, 2024
Merged

Ensures that the cursor's value marker is fully reset between values.#787
tgregg merged 1 commit intomasterfrom
reset-type-id

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
@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