mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-19 20:03:16 +00:00
segfault fixed when data is unpacked using list_hook
,
this bug is a twin to #28. Unit-test is also attached.
This commit is contained in:
parent
4ea952f39d
commit
cf89f18be7
3 changed files with 11 additions and 1 deletions
|
@ -163,6 +163,8 @@ static inline int template_callback_array_end(unpack_user* u, msgpack_unpack_obj
|
|||
{
|
||||
if (u->list_hook) {
|
||||
PyObject *new_c = PyEval_CallFunction(u->list_hook, "(O)", *c);
|
||||
if (!new_c)
|
||||
return -1;
|
||||
Py_DECREF(*c);
|
||||
*c = new_c;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue