diff --git a/ChangeLog b/ChangeLog index e09447e5e2..5d59454c74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,16 @@ +<<<<<<< current Sat Sep 8 09:33:09 2007 Tadayoshi Funaba * lib/date/format.rb (str[fp]time): now check specifications more strictly. +======= +Sat Sep 8 10:05:14 2007 Yukihiro Matsumoto + + * 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 * test/ruby/test_fiber.rb (TestFiber::test_throw): uncaught throw diff --git a/struct.c b/struct.c index f87b33b050..671788fc10 100644 --- a/struct.c +++ b/struct.c @@ -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; }