diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-07 05:38:18 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-07 05:38:18 +0000 |
commit | 978911ccee409b4a88542296d9a87bac1311df05 (patch) | |
tree | 4d534cdac13a96e332c85d886cfdf91ec33a602e /array.c | |
parent | 6bcf74c4ef3732408a357df6fa433ccc2f975a87 (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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |