Kaydet (Commit) 7d6c07fa authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1242689 Untrusted loop bound

Change-Id: Ie226805ef8d430eb3f7b3abaa54ac3af31f72f7b
üst 1409c0bd
...@@ -860,7 +860,15 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase ...@@ -860,7 +860,15 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase
DBG_ASSERT( false, "BasicManager-Stream defect!" ); DBG_ASSERT( false, "BasicManager-Stream defect!" );
return; return;
} }
for ( sal_uInt16 nL = 0; nL < nLibs; nL++ ) const size_t nMinBasicLibSize(8);
const size_t nMaxPossibleLibs = xManagerStream->remainingSize() / nMinBasicLibSize;
if (nLibs > nMaxPossibleLibs)
{
SAL_WARN("basic", "Parsing error: " << nMaxPossibleLibs <<
" max possible entries, but " << nLibs << " claimed, truncating");
nLibs = nMaxPossibleLibs;
}
for (sal_uInt16 nL = 0; nL < nLibs; ++nL)
{ {
BasicLibInfo* pInfo = BasicLibInfo::Create( *xManagerStream ); BasicLibInfo* pInfo = BasicLibInfo::Create( *xManagerStream );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment