diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-21 12:42:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-21 12:42:38 +0100 |
commit | 60aea4b2cadf367736605b09604a0818b7ae571b (patch) | |
tree | e2b743d2875eaa7ce6866ec984b0c78a07f1feb7 | |
parent | ebfa1e6c86037c4143d2ced2da5b5431e8e7e7db (diff) |
CID#736208 out of bounds access
Change-Id: I7f428106a4d64e2ee8990b2ddbe1a40a9ddd0a3e
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index c0a34c80e679..bc49164fa0a3 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3317,7 +3317,15 @@ void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule ) if( pTxtNd->IsCountedInList()) { - nLvl = static_cast< sal_uInt8 >(pTxtNd->GetActualListLevel()); + int nLevel = pTxtNd->GetActualListLevel(); + + if (nLevel < 0) + nLevel = 0; + + if (nLevel >= MAXLEVEL) + nLevel = MAXLEVEL - 1; + + nLvl = static_cast< sal_uInt8 >(nLevel); if ( pTxtNd->IsListRestart() ) { |