summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 05:38:18 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 05:38:18 +0000
commit978911ccee409b4a88542296d9a87bac1311df05 (patch)
tree4d534cdac13a96e332c85d886cfdf91ec33a602e /array.c
parent6bcf74c4ef3732408a357df6fa433ccc2f975a87 (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_5@13373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/array.c b/array.c
index a67e9233d1..0cb45ec8d6 100644
--- a/array.c
+++ b/array.c
@@ -2258,6 +2258,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);