summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 72e4667ff2..7db1315d1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Jun 15 22:17:35 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * regex.c (re_search): string might be NULL. [ruby-core:16478]
+
Sun Jun 15 22:13:13 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 e721097e32..786cebe7ae 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 e5b60cdfed..054894cf57 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-15"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080615
-#define RUBY_PATCHLEVEL 196
+#define RUBY_PATCHLEVEL 197
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8