diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-25 16:21:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-25 16:56:24 +0100 |
commit | 25e0764965e1abc2495213aea56140aec86fdd48 (patch) | |
tree | c23cc6073935598ce0e13b8f6046048f6f1b7cb1 /sw | |
parent | aee93381135a656707d68a58bea569b62ce66c9d (diff) |
coverity#1242839 Untrusted loop bound
Change-Id: Ib0e96d20f18edfab53373f153bd128f725fe335a
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8toolbar.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index 002a0bbb0c6c..e33a8c50f0fc 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -1165,6 +1165,10 @@ bool MacroNames::Read( SvStream &rS) rS.ReadUInt16( iMac ); if ( iMac ) { + //even an empty MacroName will take 2 bytes + size_t nMaxAvailableRecords = rS.remainingSize()/sizeof(sal_uInt16); + if (iMac > nMaxAvailableRecords) + return false; rgNames = new MacroName[ iMac ]; for ( sal_Int32 index = 0; index < iMac; ++index ) { |