[Libreoffice-commits] core.git: filter/source
ᚉᚐᚑᚂᚐᚅ McNamara
caolanm at redhat.com
Tue Oct 28 09:11:14 PDT 2014
filter/source/msfilter/mstoolbar.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 911faa4db7c1ea6064fdd49e3e481df6a7a0706f
Author: ᚉᚐᚑᚂᚐᚅ McNamara <caolanm at redhat.com>
Date: Tue Oct 28 16:01:22 2014 +0000
coverity#1242844 Untrusted loop bound
Change-Id: I64a805503d0c044b5c5a80df1513e35df5c39171
diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx
index 13d5505..c8ff2f0 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;
More information about the Libreoffice-commits
mailing list