Skip to content

Commit f3196ac

Browse files
committed
* 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
1 parent 80c37b7 commit f3196ac

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Fri Sep 7 16:39:23 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
22

3+
* array.c (rb_ary_fill): need integer overflow check.
4+
[ruby-dev:31738]
5+
36
* string.c (rb_str_splice): integer overflow for length.
47
[ruby-dev:31739]
58

array.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,6 +2266,9 @@ rb_ary_fill(argc, argv, ary)
22662266
}
22672267
rb_ary_modify(ary);
22682268
end = beg + len;
2269+
if (end < 0) {
2270+
rb_raise(rb_eArgError, "argument too big");
2271+
}
22692272
if (end > RARRAY(ary)->len) {
22702273
if (end >= RARRAY(ary)->aux.capa) {
22712274
REALLOC_N(RARRAY(ary)->ptr, VALUE, end);

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define RUBY_RELEASE_DATE "2007-09-07"
33
#define RUBY_VERSION_CODE 186
44
#define RUBY_RELEASE_CODE 20070907
5-
#define RUBY_PATCHLEVEL 98
5+
#define RUBY_PATCHLEVEL 99
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8

0 commit comments

Comments
 (0)