summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 13:18:59 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 13:18:59 +0000
commite4cac77252307c3311d2d799e064fb27f921b3d3 (patch)
tree594e7dee1e7a150674627ce7f932fee6af05d74f
parent1efa5d37a11b18f5822a8dc0222ca5de2ad7aa0c (diff)
merge revision(s) 16143:
* regex.c (re_search): string might be NULL. [ruby-core:16478] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--regex.c4
-rw-r--r--version.h2
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a03acf5048..005a76f4e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Jun 15 22:18:30 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * regex.c (re_search): string might be NULL. [ruby-core:16478]
+
Sun Jun 15 22:16:21 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* time.c (rb_strftime): check errno to detect strftime(3)'s error.
diff --git a/regex.c b/regex.c
index a7a831286e..45f7e20738 100644
--- a/regex.c
+++ b/regex.c
@@ -3177,6 +3177,10 @@ re_search(bufp, string, size, startpos, range, regs)
/* 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) {
diff --git a/version.h b/version.h
index 87c873afc4..ca10a89e59 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 197
+#define RUBY_PATCHLEVEL 198
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8