diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-15 12:01:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-15 12:01:14 +0000 |
commit | 18eff087dab3b67ca740d0c08705ada93e7edcb0 (patch) | |
tree | 36b09802f056e454259b7ae03af719a676def910 | |
parent | 0d8ac23d2a2b03932c5e222c5209d1e1eb9d1947 (diff) |
merges r24103 from trunk into ruby_1_9_1.
--
Check pos and strlen on Regexp#index(str, pos) [ruby-core:23660]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | string.c | 2 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Jul 14 17:29:20 2009 NARUSE, Yui <naruse@ruby-lang.org> + + * 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@tsg.ne.jp> * enumerator.c (yielder_yield_i): use rb_proc_new instead of @@ -2378,6 +2378,8 @@ rb_str_index_m(int argc, VALUE *argv, VALUE str) 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)); @@ -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 |