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

Ion Reader Fails with Assertion on Empty Buffer Read #233

Open
almann opened this issue Apr 18, 2021 · 1 comment
Open

Ion Reader Fails with Assertion on Empty Buffer Read #233

almann opened this issue Apr 18, 2021 · 1 comment

Comments

@almann
Copy link
Contributor

almann commented Apr 18, 2021

Attempting to read a clob or blob with a zero byte buffer fails with assertion:

ionc/ion_reader.c:1747: _ion_reader_read_lob_bytes_helper: Assertion `buf_max' failed.

This should not happen especially if caller code is primed to invoke this method based on the length--we can argue if the client code is not being smart about this case but the routine terminating the process for this case is definitely not correct.

almann added a commit to almann/ion-rust that referenced this issue Apr 18, 2021
amazon-ion/ion-c#233 triggers an assertion failure when reading an empty LOB,
so we avoid this case explicitly.
almann added a commit to almann/ion-rust that referenced this issue Apr 18, 2021
amazon-ion/ion-c#233 triggers an assertion failure when reading an empty LOB,
so we avoid this case explicitly.
@almann
Copy link
Contributor Author

almann commented Apr 18, 2021

See amazon-ion/ion-rust#193 for the code that fixes the repro in that package for this bug.

almann added a commit to amazon-ion/ion-rust that referenced this issue Apr 19, 2021
* [ion-c-sys] Short circuits empty case `IonCReader.read_bytes()`.

amazon-ion/ion-c#233 triggers an assertion failure when reading an empty LOB,
so we avoid this case explicitly.

* Adds more commentary on why this change is neede inline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant