Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix segfault in yajl2_c's parse_basecoro
This problem was caused by calling Py_DECREF() more than once on the static, global PyObject* "item" variable that we use to keep the "item" string literal in memory. The situation only arouse when the top-level JSON value was an array, and therefore did not hit all users necessarily. More than one of our tests use arrays as their top-level JSON values that went through parse_basecoro, so in principle we should have hit the bug, but it still went unnoticed. This might have been just luck, with the python memory allocator playing in our favor and placing valid objects back into the memory previously used by the "item" variable before we decreased its reference count again. In order to reproduce the error more reliably more tests need to be added to try and hit the problem with a higher chance. This problem was originally reported in #29, and was a direct consequence of the fix introduced to fix #28. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
- Loading branch information