diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-08 01:08:23 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-08 01:08:23 +0000 |
commit | 4e2f3bd9eb3eb3f8ac7e4feae0a5280244868cdd (patch) | |
tree | 872bba03b4294ff71641251db1fdecc00d80f9b7 | |
parent | 7877dd5ed8353543c2667f1d8995a8c3ee135017 (diff) | |
download | ruby-4e2f3bd9eb3eb3f8ac7e4feae0a5280244868cdd.tar.gz ruby-4e2f3bd9eb3eb3f8ac7e4feae0a5280244868cdd.tar.xz ruby-4e2f3bd9eb3eb3f8ac7e4feae0a5280244868cdd.zip |
* struct.c (rb_struct_s_members): check if __members__ is an
array to prevent segmentation fault. [ruby-dev:31759]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | struct.c | 3 |
2 files changed, 11 insertions, 0 deletions
@@ -1,8 +1,16 @@ +<<<<<<< current Sat Sep 8 09:33:09 2007 Tadayoshi Funaba <tadf@dotrb.org> * lib/date/format.rb (str[fp]time): now check specifications more strictly. +======= +Sat Sep 8 10:05:14 2007 Yukihiro Matsumoto <matz@ruby-lang.org> + + * struct.c (rb_struct_s_members): check if __members__ is an + array to prevent segmentation fault. [ruby-dev:31759] + +>>>>>>> patched Sat Sep 8 02:56:31 2007 Yukihiro Matsumoto <matz@ruby-lang.org> * test/ruby/test_fiber.rb (TestFiber::test_throw): uncaught throw @@ -39,6 +39,9 @@ rb_struct_s_members(VALUE klass) if (NIL_P(members)) { rb_raise(rb_eTypeError, "uninitialized struct"); } + if (TYPE(members) != T_ARRAY) { + rb_raise(rb_eTypeError, "corrupted struct"); + } return members; } |