diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-14 13:47:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-14 22:26:15 +0100 |
commit | 8c85782bbe46963e2be32c3cb406982f1790fc2f (patch) | |
tree | a4625065f9b1a51c14bab766cb611e6ed3be0541 | |
parent | ad433f15b2f567f094fc6507f2c4d2a46267bd64 (diff) |
coverity#1242892 Untrusted value as argument
Change-Id: Ia4fd0a270d42fc2da233da18d4122f786c79dc3d
Reviewed-on: https://gerrit.libreoffice.org/82697
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/filter/excel/xistream.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index f7427b9295ed..a0293e69dd6e 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -831,7 +831,7 @@ std::size_t XclImpStream::ReadUniStringExtHeader( bool& rb16Bit, sal_uInt8 nFlag OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) { - OUStringBuffer aRet(nChars); + OUStringBuffer aRet(std::min<sal_uInt16>(nChars, mnRawRecLeft / (b16Bit ? 2 : 1))); sal_uInt16 nCharsLeft = nChars; sal_uInt16 nReadSize; @@ -839,7 +839,7 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) { if( b16Bit ) { - nReadSize = ::std::min< sal_uInt16 >( nCharsLeft, mnRawRecLeft / 2 ); + nReadSize = std::min<sal_uInt16>(nCharsLeft, mnRawRecLeft / 2); OSL_ENSURE( (nReadSize <= nCharsLeft) || !(mnRawRecLeft & 0x1), "XclImpStream::ReadRawUniString - missing a byte" ); } |