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

guard against corrupt LwpTocSuperLayout

Change-Id: I18648e74d16b932cfa6fbd2057d1e9987c498fd4
üst da0b49f8
......@@ -101,17 +101,22 @@ void LwpTocSuperLayout::Read()
m_SearchItems.Read(m_pObjStrm);
sal_uInt16 i;
sal_uInt16 count = m_pObjStrm->QuickReaduInt16();
for (i = 0; (i < MAX_LEVELS) && (count > 0); i++, count--)
if (count > MAX_LEVELS)
throw std::range_error("corrupt LwpTocSuperLayout");
for (sal_uInt16 i = 0; i < count; ++i)
m_DestName[i].Read(m_pObjStrm);
count = m_pObjStrm->QuickReaduInt16();
for (i = 0; (i < MAX_LEVELS) && (count > 0); i++, count--)
if (count > MAX_LEVELS)
throw std::range_error("corrupt LwpTocSuperLayout");
for (sal_uInt16 i = 0; i < count; ++i)
m_DestPGName[i].Read(m_pObjStrm);
count = m_pObjStrm->QuickReaduInt16();
for (i = 0; i < count; i++)
if (count > MAX_LEVELS)
throw std::range_error("corrupt LwpTocSuperLayout");
for (sal_uInt16 i = 0; i < count; ++i)
m_nFlags[i] = m_pObjStrm->QuickReaduInt32();
m_pObjStrm->SkipExtra();
......
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