[前][次][番号順一覧][スレッド一覧]

ruby-changes:4649

From: ko1@a...
Date: Tue, 22 Apr 2008 17:14:23 +0900 (JST)
Subject: [ruby-changes:4649] matz - Ruby:r16143 (ruby_1_8): * regex.c (re_search): string might be NULL.

matz	2008-04-22 17:14:10 +0900 (Tue, 22 Apr 2008)

  New Revision: 16143

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/regex.c

  Log:
    * regex.c (re_search): string might be NULL.  [ruby-core:16478]

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16143&r2=16142&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/regex.c?r1=16143&r2=16142&diff_format=u

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 16142)
+++ ruby_1_8/ChangeLog	(revision 16143)
@@ -1,3 +1,7 @@
+Tue Apr 22 17:12:05 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* regex.c (re_search): string might be NULL.  [ruby-core:16478]
+
 Tue Apr 22 16:44:00 2008  Kazuhiro NISHIYAMA  <zn@m...>
 
 	* object.c (rb_obj_tap): Correct documentation; pointed out by
Index: ruby_1_8/regex.c
===================================================================
--- ruby_1_8/regex.c	(revision 16142)
+++ ruby_1_8/regex.c	(revision 16143)
@@ -3177,6 +3177,10 @@
   /* Check for out-of-range starting position.  */
   if (startpos < 0  ||  startpos > size)
     return -1;
+  if (!string) {
+    if (size == 0) string = "";
+    else return -1;
+  }
 
   /* Update the fastmap now if not correct already.  */
   if (fastmap && !bufp->fastmap_accurate) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]