summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorᚉᚐᚑᚂᚐᚅ McNamara <caolanm@redhat.com>2014-10-28 16:01:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-10-28 16:10:42 +0000
commit911faa4db7c1ea6064fdd49e3e481df6a7a0706f (patch)
tree03f33ad125f61dac81741d1fa138cea0943a8f65 /filter
parentd49755ba3ae60b0d50e1f6edcf2107f1f695017b (diff)
coverity#1242844 Untrusted loop bound
Change-Id: I64a805503d0c044b5c5a80df1513e35df5c39171
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/mstoolbar.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index 13d5505febe6..c8ff2f0c16fa 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -673,8 +673,11 @@ bool TBCCDData::Read( SvStream &rS)
{
nOffSet = rS.Tell();
rS.ReadInt16( cwstrItems );
- if ( cwstrItems )
+ if (cwstrItems > 0)
{
+ //each WString is at least one byte
+ if (rS.remainingSize() < static_cast<size_t>(cwstrItems))
+ return false;
for( sal_Int32 index=0; index < cwstrItems; ++index )
{
WString aString;