summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-10 11:07:46 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-10 11:07:46 +0000
commitfc81a580dd2c4e322a28c4f042530668f8516c60 (patch)
tree686c3c6ab2a9aa98bc25c380e01e9e5ba85a4493 /filter
parentae755d90241e9e626a58f94d8bf61b1974ea84d4 (diff)
coverity#736181 Out-of-bounds read
it should be fine, as we rely on there being at least one password char, this is the same as, commit 2d3ed7ebb592401de214eaeee68c656afbefbe05 Author: Michael Meeks <michael.meeks@collabora.com> Date: Tue Feb 25 22:48:48 2014 +0000 cid#736173 - increase default fill chars buffer size. which is another impl of this Change-Id: I5e1e07af37bea0398153ede300beed67d37d5e12
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/mscodec.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx
index c57559bfdd28..f6a4a575bcc4 100644
--- a/filter/source/msfilter/mscodec.cxx
+++ b/filter/source/msfilter/mscodec.cxx
@@ -145,16 +145,15 @@ void MSCodec_Xor95::InitKey( const sal_uInt8 pnPassData[ 16 ] )
0xBF, 0x0F, 0x00, 0x00
};
- std::size_t nIndex;
std::size_t nLen = lclGetLen( pnPassData, 16 );
const sal_uInt8* pnFillChar = spnFillChars;
- for( nIndex = nLen; nIndex < sizeof( mpnKey ); ++nIndex, ++pnFillChar )
+ for (std::size_t nIndex = nLen; nIndex < sizeof(mpnKey); ++nIndex, ++pnFillChar)
mpnKey[ nIndex ] = *pnFillChar;
SVBT16 pnOrigKey;
ShortToSVBT16( mnKey, pnOrigKey );
sal_uInt8* pnKeyChar = mpnKey;
- for( nIndex = 0; nIndex < sizeof( mpnKey ); ++nIndex, ++pnKeyChar )
+ for (std::size_t nIndex = 0; nIndex < sizeof(mpnKey); ++nIndex, ++pnKeyChar)
{
*pnKeyChar ^= pnOrigKey[ nIndex & 0x01 ];
lclRotateLeft( *pnKeyChar, mnRotateDistance );