diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 13:18:11 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-15 13:18:11 +0000 |
commit | 5150a36a97d192a5a184ec4b2c68b510d6971c59 (patch) | |
tree | b1b06a9056666f1201a68ed280b5c8917d017d07 | |
parent | 9d85efb74d19a741f7da42b424868a32f117fa23 (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_5@17252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | regex.c | 4 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 9 insertions, 1 deletions
@@ -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. @@ -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) { @@ -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 |