summaryrefslogtreecommitdiff
path: root/msgpack/unpack_template.h
diff options
context:
space:
mode:
authorINADA Naoki <inada-n@klab.com>2012-12-22 12:42:36 +0900
committerINADA Naoki <inada-n@klab.com>2012-12-22 12:42:36 +0900
commitce2c5b22efcbbbc5598c7a631b3558d757b8b9dc (patch)
tree08c977424cb16196e2252836359118e3fbb7b0f9 /msgpack/unpack_template.h
parent79e44f86c9ec554f56b9807f909e21887c36d166 (diff)
downloadmsgpack-python-ce2c5b22efcbbbc5598c7a631b3558d757b8b9dc.tar.gz
Check return value of _end functions.
Diffstat (limited to 'msgpack/unpack_template.h')
-rw-r--r--msgpack/unpack_template.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/msgpack/unpack_template.h b/msgpack/unpack_template.h
index 6080a51..9450943 100644
--- a/msgpack/unpack_template.h
+++ b/msgpack/unpack_template.h
@@ -145,7 +145,7 @@ msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const c
if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */ \
if(construct_cb(func)(user, count_, &stack[top].obj) < 0) { goto _failed; } \
if((count_) == 0) { obj = stack[top].obj; \
- construct_cb(func##_end)(user, &obj); \
+ if (construct_cb(func##_end)(user, &obj) < 0) { goto _failed; } \
goto _push; } \
stack[top].ct = ct_; \
stack[top].size = count_; \
@@ -346,7 +346,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;
@@ -360,7 +360,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;