From 89ce16df39f67ac77785a63b4111c353f0a606a3 Mon Sep 17 00:00:00 2001 From: Alexei Romanoff Date: Fri, 12 Oct 2012 12:32:32 +0300 Subject: A segfault fixed in the issue https://github.com/msgpack/msgpack-python/issues/28 --- msgpack/unpack_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'msgpack/unpack_template.h') diff --git a/msgpack/unpack_template.h b/msgpack/unpack_template.h index 7d07601..9d13062 100644 --- a/msgpack/unpack_template.h +++ b/msgpack/unpack_template.h @@ -361,7 +361,7 @@ _push: if(construct_cb(_map_item)(user, c->count, &c->obj, c->map_key, obj) < 0) { goto _failed; } if(++c->count == c->size) { obj = c->obj; - construct_cb(_map_end)(user, &obj); + if (construct_cb(_map_end)(user, &obj) < 0) { goto _failed; } --top; /*printf("stack pop %d\n", top);*/ goto _push; -- cgit v1.2.1 From cf89f18be7614d6d55bb9eb7e9bf0e10d42a8508 Mon Sep 17 00:00:00 2001 From: Alexei Romanoff Date: Fri, 12 Oct 2012 13:19:53 +0300 Subject: segfault fixed when data is unpacked using `list_hook`, this bug is a twin to #28. Unit-test is also attached. --- msgpack/unpack_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'msgpack/unpack_template.h') diff --git a/msgpack/unpack_template.h b/msgpack/unpack_template.h index 9d13062..8a57f0d 100644 --- a/msgpack/unpack_template.h +++ b/msgpack/unpack_template.h @@ -347,7 +347,7 @@ _push: if(construct_cb(_array_item)(user, c->count, &c->obj, obj) < 0) { goto _failed; } if(++c->count == c->size) { obj = c->obj; - construct_cb(_array_end)(user, &obj); + if (construct_cb(_array_end)(user, &obj) < 0) { goto _failed; } --top; /*printf("stack pop %d\n", top);*/ goto _push; -- cgit v1.2.1