diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-16 13:45:37 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-16 13:45:37 +0000 |
commit | 415a9700fe809af22cd5c5334a7b69c6ce667f3b (patch) | |
tree | 12bba629aff346e0a3ba9ea2ad013e089ce5ed22 /bignum.c | |
parent | 49fe6e08436c277f037e5c2e132a60153bc71a1d (diff) |
* bignum.c (bigtrunc): RBIGNUM(x)->len may be zero. out of bound
access. [ruby-dev:31404]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -104,6 +104,7 @@ bigtrunc(x) long len = RBIGNUM(x)->len; BDIGIT *ds = BDIGITS(x); + if (len == 0) return x; while (--len && !ds[len]); RBIGNUM(x)->len = ++len; return x; |