From 60aea4b2cadf367736605b09604a0818b7ae571b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 21 Sep 2013 12:42:38 +0100 Subject: CID#736208 out of bounds access Change-Id: I7f428106a4d64e2ee8990b2ddbe1a40a9ddd0a3e --- sw/source/filter/ww8/ww8atr.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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() ) { -- cgit