Skip to content

Commit 7375cb6

Browse files
committed
Add a protection for malformed data
1 parent 149f422 commit 7375cb6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

msgpack_unpack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,10 @@ int msgpack_unserialize_map_item(msgpack_unserialize_data *unpack, zval **contai
666666
} else {
667667
msgpack_var_replace(val, nval);
668668
}
669-
msgpack_stack_pop(unpack->var_hash, key);
669+
if (MSGPACK_IS_STACK_VALUE(key)) {
670+
/* just in case for malformed data */
671+
msgpack_stack_pop(unpack->var_hash, key);
672+
}
670673

671674
deps = unpack->deps - 1;
672675
unpack->stack[deps]--;

0 commit comments

Comments
 (0)