From 67d75e7a8152b1402fe0a1b401f098d063366886 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 26 Jul 2006 07:43:16 +0000 Subject: * string.c (rb_str_scan): add string modification check. [ruby-core:7216] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 61d59c5e0..e3b2bcd53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 26 16:39:07 2006 Yukihiro Matsumoto + + * string.c (rb_str_scan): add string modification check. + [ruby-core:7216] + Wed Jul 26 16:06:03 2006 Yukihiro Matsumoto * lib/cgi.rb (CGI::QueryExtension::read_multipart): check diff --git a/string.c b/string.c index 16939e15f..816dde4b0 100644 --- a/string.c +++ b/string.c @@ -3919,6 +3919,7 @@ rb_str_scan(VALUE str, VALUE pat) VALUE result; long start = 0; VALUE match = Qnil; + char *p = RSTRING(str)->ptr; long len = RSTRING(str)->len; pat = get_pat(pat, 1); if (!rb_block_given_p()) { @@ -3936,6 +3937,7 @@ rb_str_scan(VALUE str, VALUE pat) match = rb_backref_get(); rb_match_busy(match); rb_yield(result); + str_mod_check(str, p, len); rb_backref_set(match); /* restore $~ value */ } rb_backref_set(match); -- cgit