From 507a5116c6aa164577a8b3c471489c9bd6bd62aa Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 8 Sep 2007 16:59:49 +0000 Subject: [PATCH] * marshal.c (r_object0): check T_STRUCT type for structs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ marshal.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index bb78fa70fd..f362e85893 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Sep 9 01:59:08 2007 Tanaka Akira + + * marshal.c (r_object0): check T_STRUCT type for structs. + Sun Sep 9 01:17:05 2007 Tanaka Akira * marshal.c (r_object0): don't call user-defined initialize for diff --git a/marshal.c b/marshal.c index cb5169bec1..f540e52f37 100644 --- a/marshal.c +++ b/marshal.c @@ -1263,6 +1263,9 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) } v = rb_obj_alloc(klass); + if (TYPE(v) != T_STRUCT) { + rb_raise(rb_eArgError, "dump format error"); + } v = r_entry(v, arg); values = rb_ary_new2(len); for (i=0; i