merge revision(s) 17756:

* array.c (rb_ary_fill): check if beg is too big.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2008-07-01 06:14:29 +00:00
parent cea5e4cbda
commit c2034afbab
3 changed files with 11 additions and 6 deletions

View file

@ -2419,7 +2419,7 @@ rb_ary_fill(argc, argv, ary)
if (len < 0) {
return ary;
}
if (len > ARY_MAX_SIZE - beg) {
if (beg >= ARY_MAX_SIZE || len > ARY_MAX_SIZE - beg) {
rb_raise(rb_eArgError, "argument too big");
}
end = beg + len;