ruby-changes:1919
From: ko1@a...
Date: 8 Sep 2007 10:08:35 +0900
Subject: [ruby-changes:1919] matz - Ruby:r13410 (trunk): * struct.c (rb_struct_s_members): check if __members__ is an
matz 2007-09-08 10:08:23 +0900 (Sat, 08 Sep 2007) New Revision: 13410 Modified files: trunk/ChangeLog trunk/struct.c Log: * struct.c (rb_struct_s_members): check if __members__ is an array to prevent segmentation fault. [ruby-dev:31759] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13410&r2=13409 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/struct.c?r1=13410&r2=13409 Index: ChangeLog =================================================================== --- ChangeLog (revision 13409) +++ ChangeLog (revision 13410) @@ -1,3 +1,4 @@ +<<<<<<< current Sat Sep 8 09:33:09 2007 Tadayoshi Funaba <tadf@d...> * lib/date/format.rb (str[fp]time): now check specifications more @@ -3,4 +4,11 @@ strictly. +======= +Sat Sep 8 10:05:14 2007 Yukihiro Matsumoto <matz@r...> + + * 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@r...> Index: struct.c =================================================================== --- struct.c (revision 13409) +++ struct.c (revision 13410) @@ -39,6 +39,9 @@ if (NIL_P(members)) { rb_raise(rb_eTypeError, "uninitialized struct"); } + if (TYPE(members) != T_ARRAY) { + rb_raise(rb_eTypeError, "corrupted struct"); + } return members; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml