diff options
author | Alexei Romanoff <drednout.by@gmail.com> | 2012-10-12 13:19:53 +0300 |
---|---|---|
committer | Alexei Romanoff <drednout.by@gmail.com> | 2012-10-12 13:19:53 +0300 |
commit | cf89f18be7614d6d55bb9eb7e9bf0e10d42a8508 (patch) | |
tree | e8896d1a6e740edd28551c6f0320f356b58c512e /msgpack/unpack.h | |
parent | 4ea952f39dc5ff1231f780252d8d4efb16b2be3b (diff) | |
download | msgpack-python-cf89f18be7614d6d55bb9eb7e9bf0e10d42a8508.tar.gz |
segfault fixed when data is unpacked using `list_hook`,
this bug is a twin to #28.
Unit-test is also attached.
Diffstat (limited to 'msgpack/unpack.h')
-rw-r--r-- | msgpack/unpack.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/msgpack/unpack.h b/msgpack/unpack.h index 61e5d91..3dc88e5 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -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; } |