diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-02-27 22:24:36 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-02-28 14:02:33 +0100 |
commit | 0d4ee442f170eee4c35b9a1b1cb596f71d256b1e (patch) | |
tree | 8b42d4616b4f6b90f6f803abebeb60587da19cd0 | |
parent | b440cfcc548f3e9c74001c1e692b35ff272c409a (diff) |
fdo#61309: writerfilter: filter out enormous numbering levels
Change-Id: Iafef1c2ca2ca072bd604946fbe19b6a24e323512
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 5 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 8fd8e382e81b..f7762ab13dac 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -535,6 +535,11 @@ throw (lang::IllegalArgumentException) sal_Int16 nLevel = 0; if (rValue >>= nLevel) { + if (nLevel < 0 || MAXLEVEL <= nLevel) + { + throw lang::IllegalArgumentException( + "invalid NumberingLevel", 0, 0); + } pTxtNd->SetAttrListLevel(nLevel); } } diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 9e2fdff7bd5b..6892f8289671 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1540,7 +1540,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType case NS_sprm::LN_PBrcp: break; // sprmPBrcp case NS_sprm::LN_PIlvl: // sprmPIlvl - //todo: Numbering level will be implemented in the near future (OOo 3.0?) + if (nIntValue < 0 || 10 <= nIntValue) // Writer can't do everything + { + SAL_INFO("writerfilter", + "unsupported numbering level " << nIntValue); + break; + } if( m_pImpl->IsStyleSheetImport() ) { //style sheets cannot have a numbering rule attached |