From c349959778f17cb322b065a02da4183825f8e69e Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 5 Sep 2007 13:06:01 +0000 Subject: [PATCH] * string.c (rb_str_splice): integer overflow for length. [ruby-dev:31739] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 2 +- version.h | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c758c3123..c109511374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 5 22:02:27 2007 Yukihiro Matsumoto + + * string.c (rb_str_splice): integer overflow for length. + [ruby-dev:31739] + Tue Sep 4 20:43:44 2007 Masaki Suketa * ext/win32ole/win32ole.c: add WIN32OLE_EVENT#unadvise. diff --git a/string.c b/string.c index d6f09b0bf7..88c5bf4706 100644 --- a/string.c +++ b/string.c @@ -1893,7 +1893,7 @@ rb_str_splice(VALUE str, long beg, long len, VALUE val) } beg += slen; } - if (slen < beg + len) { + if (slen < len || slen < beg + len) { len = slen - beg; } p = str_nth(RSTRING_PTR(str), RSTRING_END(str), beg, enc); diff --git a/version.h b/version.h index edc9cf355f..c49a73f30b 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-09-04" +#define RUBY_RELEASE_DATE "2007-09-05" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20070904 +#define RUBY_RELEASE_CODE 20070905 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 9 -#define RUBY_RELEASE_DAY 4 +#define RUBY_RELEASE_DAY 5 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[];