ruby-changes:40877
From: nobu <ko1@a...>
Date: Tue, 8 Dec 2015 23:33:22 +0900 (JST)
Subject: [ruby-changes:40877] nobu:r52956 (trunk): check loading object index range
nobu 2015-12-08 23:33:11 +0900 (Tue, 08 Dec 2015) New Revision: 52956 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52956 Log: check loading object index range Modified files: trunk/compile.c Index: compile.c =================================================================== --- compile.c (revision 52955) +++ compile.c (revision 52956) @@ -7979,6 +7979,9 @@ ibf_load_object(const struct ibf_load *l https://github.com/ruby/ruby/blob/trunk/compile.c#L7979 if (object_index == 0) { return Qnil; } + else if (object_index >= load->header->object_list_size) { + rb_raise(rb_eIndexError, "object index out of range: %"PRIdVALUE, object_index); + } else { VALUE obj = rb_ary_entry(load->obj_list, (long)object_index); if (obj == Qnil) { /* TODO: avoid multiple Qnil load */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/