@@ -918,13 +918,13 @@ mrb_unpack_msgpack_obj(mrb_state* mrb, const msgpack::object& obj)
918918
919919 case msgpack::type::EXT: {
920920 auto ext_type = obj.via .ext .type ();
921- mrb_msgpack_ctx* ctx = MRB_MSGPACK_CONTEXT (mrb);
922- if (ext_type == ctx->ext_type && ctx->sym_unpacker != nullptr ) {
923- return ctx->sym_unpacker (mrb, obj);
924- }
925921 if (ext_type == -1 ) {
926922 return mrb_msgpack_unpack_timestamp (mrb, obj);
927923 }
924+ mrb_msgpack_ctx* ctx = MRB_MSGPACK_CONTEXT (mrb);
925+ if (ctx->sym_unpacker != nullptr && ext_type == ctx->ext_type ) {
926+ return ctx->sym_unpacker (mrb, obj);
927+ }
928928 mrb_value unpacker = mrb_hash_get (
929929 mrb,
930930 ext_unpackers_hash (mrb),
@@ -1108,11 +1108,18 @@ mrb_msgpack_unpack_lazy_m(mrb_state *mrb, mrb_value self)
11081108 mrb_raise (mrb, E_MSGPACK_ERROR, " ObjectHandle is not initialized" );
11091109 return mrb_undef_value ();
11101110 }
1111-
1111+ msgpack::unpack_limit limit (
1112+ MSGPACK_ARY_LIMIT, // array
1113+ MSGPACK_MAP_LIMIT, // map
1114+ MSGPACK_STR_LIMIT, // str
1115+ MSGPACK_BIN_LIMIT, // bin
1116+ MSGPACK_EXT_LIMIT, // ext
1117+ MSGPACK_DEPTH_LIMIT // depth
1118+ );
11121119 msgpack::unpack (handle->oh ,
11131120 RSTRING_PTR (data),
11141121 RSTRING_LEN (data),
1115- handle->off );
1122+ handle->off , nullptr , nullptr , limit );
11161123
11171124 return object_handle;
11181125 }
0 commit comments