diff --git a/ChangeLog b/ChangeLog index acc49fbbcc..d6deffd149 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Oct 27 10:50:53 2012 Aaron Patterson + + * object.c (rb_mod_const_get): make sure the constant name is + converted to a string before searching. [ruby-core:48405] + Sat Oct 27 10:12:13 2012 URABE Shyouhei * iseq.c (rb_iseq_compile_with_option): Instead of testing diff --git a/object.c b/object.c index a7eccb8ced..f3e5ec241b 100644 --- a/object.c +++ b/object.c @@ -1905,9 +1905,12 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod) } if (SYMBOL_P(name)) { - name = rb_sym_to_s(name); + name = rb_sym_to_s(name); } + name = rb_check_string_type(name); + Check_Type(name, T_STRING); + enc = rb_enc_get(name); path = RSTRING_PTR(name);