diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-23 10:47:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-23 11:13:24 +0100 |
commit | 4a32dc6562f8e38dcc8d9c970c566c6bfcd3d7e4 (patch) | |
tree | 9a1edc6c03cb34ca46f03e9a437d8ebe9b469ebb /sw | |
parent | 04d34c63c7f988eb285366e899f899ccd7109482 (diff) |
coverity#1242682 Untrusted loop bound
Change-Id: Ib9b7c148f0679e458821cf2f30ef14d815b96706
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 9b10f1e702db..0f049a4c9e97 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -475,6 +475,10 @@ bool Sttb::Read( SvStream& rS ) rS.ReadUInt16( fExtend ).ReadUInt16( cData ).ReadUInt16( cbExtra ); if ( cData ) { + //if they are all going to be empty strings, how many could there be + const size_t nMaxPossibleRecords = rS.remainingSize() / sizeof(sal_uInt16); + if (cData > nMaxPossibleRecords) + return false; for ( sal_Int32 index = 0; index < cData; ++index ) { SBBItem aItem; |