diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-07 07:41:46 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-07 07:41:46 +0000 |
commit | f3196aca3c1104b5c222488254033badfda520dd (patch) | |
tree | 649005f7d93e4770f20a2b597db05c38609f20ac /array.c | |
parent | 80c37b72cf6f57718227076366a651bbc1f73960 (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
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |