diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-10-15 12:11:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-10-15 12:18:48 +0100 |
commit | ca85f280e26b9090c06b8b2092e3dde570043e16 (patch) | |
tree | 31c9140b4df9d932dcd43c5b2e01a8f8174561f5 /sax/source | |
parent | ByteString->rtl::OString (diff) | |
download | core-ca85f280e26b9090c06b8b2092e3dde570043e16.tar.gz core-ca85f280e26b9090c06b8b2092e3dde570043e16.zip |
Fix overflow in smoketest, promotion from sal_Int32 to sal_Int64 doesn't happen before assign
Diffstat (limited to 'sax/source')
-rw-r--r-- | sax/source/tools/converter.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 092e82df6281..e9a08c4b7d52 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -400,8 +400,9 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer, break; } - OSL_ENSURE(nMeasure <= SAL_MAX_INT64 / nMul, "convertMeasure: overflow"); - sal_Int64 nValue = nMeasure * nMul; + sal_Int64 nValue = nMeasure; + OSL_ENSURE(nValue <= SAL_MAX_INT64 / nMul, "convertMeasure: overflow"); + nValue *= nMul; nValue /= nDiv; nValue += 5; nValue /= 10; |