diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 10:19:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-29 10:19:48 +0000 |
commit | 50ba0ce29ea2b09bc2975357b7e40706bb9f4194 (patch) | |
tree | 1ce232461d9651c0843152210bbc6a7af0da1f0d /array.c | |
parent | 51bd9cada87c6f07499d767dc712f0177cb19a08 (diff) |
* array.c (rb_ary_fill): check for negative length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2413,6 +2413,7 @@ rb_ary_fill(argc, argv, ary) if (beg < 0) beg = 0; } len = NIL_P(arg2) ? RARRAY(ary)->len - beg : NUM2LONG(arg2); + if (len < 0) rb_raise(rb_eIndexError, "negative length (%ld)", len); break; } rb_ary_modify(ary); |