From 9692c7d285f85dd8a90cf156ff212969bc79135b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 9 Oct 2013 16:27:28 +0100 Subject: CID#736197 out of bounds Change-Id: I9b105926b812e4341700d87d77288fe429beda53 --- sw/source/core/txtnode/ndtxt.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index e002cee8d4b3..489524217cb7 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2729,7 +2729,15 @@ long SwTxtNode::GetLeftMarginWithNum( sal_Bool bTxtLeft ) const const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L; if( pRule ) { - const SwNumFmt& rFmt = pRule->Get(static_cast(GetActualListLevel())); + int nLevel = GetActualListLevel(); + + if (nLevel < 0) + nLevel = 0; + + if (nLevel >= MAXLEVEL) + nLevel = MAXLEVEL - 1; + + const SwNumFmt& rFmt = pRule->Get(static_cast(nLevel)); if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { -- cgit