fixed: buffer overflow in Big::ToInt(Int<int_size> & result)

git-svn-id: svn://ttmath.org/publicrep/ttmath/branches/0.8.x@211 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2009-10-15 01:40:13 +00:00
parent 5ef27bdbd0
commit e046aba6d2
2 changed files with 8 additions and 6 deletions

View File

@ -9,6 +9,7 @@ Version 0.8.6 prerelease (2009.10.07):
* fixed: Big::operator>> didn't correctly recognize values in scientific mode (with 'e' character)
* fixed: Int::FromString(const tt_string & s, uint b = 10)
didn't use 'b' (always was '10')
* fixed: buffer overflow in Big::ToInt(Int<int_size> & result)
Version 0.8.5 (2009.06.16):

View File

@ -1887,6 +1887,7 @@ public:
if( exponent > maxbit + sint(int_size*TTMATH_BITS_PER_UINT) )
// if exponent > (maxbit + sint(int_size*TTMATH_BITS_PER_UINT)) the value can't be passed
// into the 'Int<int_size>' type (it's too big)
return 1;
if( exponent <= maxbit )
// our value is from range (-1,1) and we return zero