summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-04 17:03:24 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-05 16:43:50 +0100
commitbec0ad463a39a9d66fc8ab613d0a26f0fa59b00d (patch)
treee5961e4a7a3f0f21c0af0f9dffc296897612b9cc /comphelper
parent8537d88d4f13bf5b4a6f556a9742d4e0dab316bb (diff)
tdf#120703 PVS: V1028 fix unexpected integer overflow
V1028 Possible overflow. Consider casting arguments of the operator to the type instead of casting its result. V547 Expression 'nNewSize > ((sal_Int32) 0x7FFFFFFF)' is always false. Change-Id: I7107b162d88c9d3f97019effcac1f9cfab52a66c Reviewed-on: https://gerrit.libreoffice.org/62846 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/streaming/memorystream.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx
index 39b2fa0a63c5..77cb69251d5e 100644
--- a/comphelper/source/streaming/memorystream.cxx
+++ b/comphelper/source/streaming/memorystream.cxx
@@ -190,7 +190,7 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< sal_Int8 >& aData )
const sal_Int32 nBytesToWrite( aData.getLength() );
if( nBytesToWrite )
{
- sal_Int64 nNewSize = static_cast< sal_Int64 >( mnCursor + nBytesToWrite );
+ sal_Int64 nNewSize = static_cast<sal_Int64>(mnCursor) + nBytesToWrite;
if( nNewSize > SAL_MAX_INT32 )
{
OSL_ASSERT(false);