summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 07:41:46 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 07:41:46 +0000
commitf3196aca3c1104b5c222488254033badfda520dd (patch)
tree649005f7d93e4770f20a2b597db05c38609f20ac
parent80c37b72cf6f57718227076366a651bbc1f73960 (diff)
* array.c (rb_ary_fill): need integer overflow check.
[ruby-dev:31738] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog3
-rw-r--r--array.c3
-rw-r--r--version.h2
3 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f88ee4..c5286a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
Fri Sep 7 16:39:23 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * array.c (rb_ary_fill): need integer overflow check.
+ [ruby-dev:31738]
+
* string.c (rb_str_splice): integer overflow for length.
[ruby-dev:31739]
diff --git a/array.c b/array.c
index d392fc1..3bd8862 100644
--- a/array.c
+++ b/array.c
@@ -2266,6 +2266,9 @@ rb_ary_fill(argc, argv, ary)
}
rb_ary_modify(ary);
end = beg + len;
+ if (end < 0) {
+ rb_raise(rb_eArgError, "argument too big");
+ }
if (end > RARRAY(ary)->len) {
if (end >= RARRAY(ary)->aux.capa) {
REALLOC_N(RARRAY(ary)->ptr, VALUE, end);
diff --git a/version.h b/version.h
index cbf9a89..e979388 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-09-07"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20070907
-#define RUBY_PATCHLEVEL 98
+#define RUBY_PATCHLEVEL 99
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8