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

coverity#1341876 Untrusted loop bound

Change-Id: I5191a48d3cadc8b9e4c1cc5f4ea99adb0071002f
üst 18952ac1
...@@ -6347,8 +6347,8 @@ void MSOPropertyBagStore::Read(SvStream& rStream) ...@@ -6347,8 +6347,8 @@ void MSOPropertyBagStore::Read(SvStream& rStream)
} }
MSOProperty::MSOProperty() MSOProperty::MSOProperty()
: m_nKey(0), : m_nKey(0)
m_nValue(0) , m_nValue(0)
{ {
} }
...@@ -6369,6 +6369,13 @@ void MSOPropertyBag::Read(SvStream& rStream) ...@@ -6369,6 +6369,13 @@ void MSOPropertyBag::Read(SvStream& rStream)
sal_uInt16 cProp(0); sal_uInt16 cProp(0);
rStream.ReadUInt16(cProp); rStream.ReadUInt16(cProp);
rStream.SeekRel(2); // cbUnknown rStream.SeekRel(2); // cbUnknown
//each MSOProperty is 8 bytes in size
size_t nMaxPossibleRecords = rStream.remainingSize() / 8;
if (cProp > nMaxPossibleRecords)
{
SAL_WARN("sw.ww8", cProp << " records claimed, but max possible is " << nMaxPossibleRecords);
cProp = nMaxPossibleRecords;
}
for (sal_uInt16 i = 0; i < cProp; ++i) for (sal_uInt16 i = 0; i < cProp; ++i)
{ {
MSOProperty aProperty; MSOProperty aProperty;
......
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