summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 07:39:32 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-25 07:39:32 +0000
commit7e2e3dc85d8c02672bc7486630424e7df95ef28b (patch)
tree52af64559189d0454b8b82f86bc6a5475816b6e7 /rational.c
parent76dc4b9a24863717e7b4f722105eec044f85801b (diff)
merge revision(s) 34803:
* complex.c (nucomp_marshal_load): raise error on invalid data. reported by John Firebaugh [ruby-core:42860] [Bug #6076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rational.c b/rational.c
index 40b480df6e..8aced2aee8 100644
--- a/rational.c
+++ b/rational.c
@@ -1606,6 +1606,8 @@ nurat_marshal_load(VALUE self, VALUE a)
{
get_dat1(self);
Check_Type(a, T_ARRAY);
+ if (RARRAY_LEN(a) != 2)
+ rb_raise(rb_eArgError, "marshaled rational must have an array whose length is 2 but %ld", RARRAY_LEN(a));
dat->num = RARRAY_PTR(a)[0];
dat->den = RARRAY_PTR(a)[1];
rb_copy_generic_ivar(self, a);