summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-14 18:36:14 (GMT)
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-14 18:36:14 (GMT)
commitfa0e37646ad58f1f4d5c70e6d5bf566a0f51fbf4 (patch)
treef66a6b36d6cb8dc3001489c3b86a34d6657fe88e /marshal.c
parent4358ff468b7dae1910dd8c112f9d947a620ef03c (diff)
* marshal.c (r_object0): Fix Marshal crash for corrupt extended object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index d64e5ff..6639e03 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1585,6 +1585,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
{
VALUE path = r_unique(arg);
VALUE m = rb_path_to_class(path);
+ if (NIL_P(extmod)) extmod = rb_ary_tmp_new(0);
if (RB_TYPE_P(m, T_CLASS)) { /* prepended */
VALUE c;
@@ -1604,7 +1605,6 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
}
else {
must_be_module(m, path);
- if (NIL_P(extmod)) extmod = rb_ary_tmp_new(0);
rb_ary_push(extmod, m);
v = r_object0(arg, 0, extmod);