summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-05 13:27:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-05 13:27:52 +0000
commit6ed97e92948afabf67569552951e9bc2b1c2bd66 (patch)
tree58f04a0417df5dffec4e0618cd3b2ce1e1df7697 /array.c
parentbf0c93851a4345ed2986387bda5d72ca3afb4a75 (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@13344 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 0ead081..bb79327 100644
--- a/array.c
+++ b/array.c
@@ -2264,6 +2264,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);