From e046aba6d20a7978d32880cb81014504e5e56d14 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 15 Oct 2009 01:40:13 +0000 Subject: [PATCH] fixed: buffer overflow in Big::ToInt(Int & result) git-svn-id: svn://ttmath.org/publicrep/ttmath/branches/0.8.x@211 e52654a7-88a9-db11-a3e9-0013d4bc506e --- CHANGELOG | 13 +++++++------ ttmath/ttmathbig.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ce27724..52c68ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,14 +1,15 @@ Version 0.8.6 prerelease (2009.10.07): - * fixed: UInt::SetBitInWord(uint & value, uint bit) set 1 if the bit was - equal 1 (should be set 2) - this affected only no-asm parts - when macro TTMATH_NOASM was defined - * fixed: UInt::MulInt(uint ss2) - there was a buffer overflow when value_size was equal 1 - * fixed: UInt::AddVector() and UInt::SubVector() didn't want to compile + * fixed: UInt::SetBitInWord(uint & value, uint bit) set 1 if the bit was + equal 1 (should be set 2) + this affected only no-asm parts - when macro TTMATH_NOASM was defined + * fixed: UInt::MulInt(uint ss2) + there was a buffer overflow when value_size was equal 1 + * fixed: UInt::AddVector() and UInt::SubVector() didn't want to compile when macro TTMATH_NOASM was defined * 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 & result) Version 0.8.5 (2009.06.16): diff --git a/ttmath/ttmathbig.h b/ttmath/ttmathbig.h index fc0760c..0a535b6 100644 --- a/ttmath/ttmathbig.h +++ b/ttmath/ttmathbig.h @@ -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' type (it's too big) + return 1; if( exponent <= maxbit ) // our value is from range (-1,1) and we return zero