ruby-changes:12422
From: yugui <ko1@a...>
Date: Wed, 15 Jul 2009 21:03:08 +0900 (JST)
Subject: [ruby-changes:12422] Ruby:r24123 (ruby_1_9_1): merges r24103 from trunk into ruby_1_9_1.
yugui 2009-07-15 21:01:14 +0900 (Wed, 15 Jul 2009) New Revision: 24123 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24123 Log: merges r24103 from trunk into ruby_1_9_1. -- Check pos and strlen on Regexp#index(str, pos) [ruby-core:23660] Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/string.c branches/ruby_1_9_1/version.h Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 24122) +++ ruby_1_9_1/ChangeLog (revision 24123) @@ -1,3 +1,8 @@ +Tue Jul 14 17:29:20 2009 NARUSE, Yui <naruse@r...> + + * string.c (rb_str_index_m): return nil if pos is out of string. + [ruby-core:23660] + Tue Jul 14 01:06:31 2009 Yusuke Endoh <mame@t...> * enumerator.c (yielder_yield_i): use rb_proc_new instead of Index: ruby_1_9_1/string.c =================================================================== --- ruby_1_9_1/string.c (revision 24122) +++ ruby_1_9_1/string.c (revision 24123) @@ -2378,6 +2378,8 @@ switch (TYPE(sub)) { case T_REGEXP: + if (pos > str_strlen(str, STR_ENC_GET(str))) + return Qnil; pos = str_offset(RSTRING_PTR(str), RSTRING_END(str), pos, rb_enc_check(str, sub), single_byte_optimizable(str)); Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 24122) +++ ruby_1_9_1/version.h (revision 24123) @@ -4,7 +4,7 @@ #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -#define RUBY_PATCHLEVEL 236 +#define RUBY_PATCHLEVEL 237 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 7 #define RUBY_RELEASE_DAY 12 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/