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

coverity#1242570 Untrusted value as argument

Change-Id: Ic79bd1931ee291746b6dae138b3181d4baddbe3e
üst 689f47d9
...@@ -883,8 +883,18 @@ void ImageMap::ImpWriteImageMap( SvStream& rOStm, const OUString& rBaseURL ) con ...@@ -883,8 +883,18 @@ void ImageMap::ImpWriteImageMap( SvStream& rOStm, const OUString& rBaseURL ) con
void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount, const OUString& rBaseURL ) void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount, const OUString& rBaseURL )
{ {
const size_t nMinRecordSize = 12; //circle, three 32bit numbers
const size_t nMaxRecords = rIStm.remainingSize() / nMinRecordSize;
if (nCount > nMaxRecords)
{
SAL_WARN("svtools.misc", "Parsing error: " << nMaxRecords << " max possible entries, but " <<
nCount << " claimed, truncating");
nCount = nMaxRecords;
}
// neue Objekte einlesen // neue Objekte einlesen
for ( size_t i = 0; i < nCount; i++ ) for (size_t i = 0; i < nCount; ++i)
{ {
sal_uInt16 nType; sal_uInt16 nType;
......
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