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

Fix invalid memory access in ionc_write #376

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

nirosys
Copy link
Contributor

@nirosys nirosys commented Oct 18, 2024

Issue #, if available: #375

Description of changes:
The ionc extension had a few uninitialized pointers defined in ionc_write that would get Py_DECREF'd when the arguments provided where invalid. This was found with the feature added with #372, when an extra parameter was passed to track whether to print trialing commas or not.

This PR initializes the values to NULL and changes the Py_DECREF to Py_XDECREF because Py_DECREF doesn't handle NULL values. Unit tests were also added to ensure we're returning an exception and not blowing up in these cases.


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

@nirosys
Copy link
Contributor Author

nirosys commented Oct 18, 2024

Looks like PyPy 3.8 is failing due to ujson and rapidjson extension build issues.. 3.10 pypy on macos looks to be failing because of a linker option in rapidjson.

@nirosys nirosys marked this pull request as ready for review October 18, 2024 19:25
@nirosys nirosys requested a review from rmarrowstone October 18, 2024 19:25
@rmarrowstone
Copy link
Contributor

Looks like PyPy 3.8 is failing due to ujson and rapidjson extension build issues.. 3.10 pypy on macos looks to be failing because of a linker option in rapidjson.

We should defintely have checks that pass by default.

I'm not concerned about the benchmark for those formats not working on PyPy. I think we were just benchmarking against plain old json in fact, and IIRC we had disabled pypy for those? If not, or if it got lost somehow, we should.

@nirosys nirosys merged commit eac299b into amazon-ion:master Oct 18, 2024
35 of 45 checks passed
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