diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-19 02:13:21 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-19 02:13:21 +0000 |
commit | de7245982714246631617299b6501fa0a0f472d7 (patch) | |
tree | 362cc8e88367c6c99f8e1d4153e3304baa718b8e /bignum.c | |
parent | d9a45b677e559457bdef2118cd2829cce67501fa (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_6@13468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r-- | bignum.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -103,6 +103,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; |