diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-16 09:41:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-16 11:59:50 +0100 |
commit | 8df4f86d27df14d22eec4894aba86e551ea9c4a1 (patch) | |
tree | 4dace69562fe5ebf1c55e86a006637d8de64ba25 /sw | |
parent | 557de68e965a5d1b0fb56270d5c5f46ebb9cd0fc (diff) |
CID#982804 out of bounds
Change-Id: I134944d8c4a1312f65ff7c3df98d8828bfc96b15
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/edit/edattr.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 4306fb5f38ae..ded5702c6e80 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -464,7 +464,15 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, const SwNumRule* pNumRule = rTNd.GetNumRule(); if(pNumRule) { - const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) ); + int nListLevel = rTNd.GetActualListLevel(); + + if (nListLevel < 0) + nListLevel = 0; + + if (nListLevel >= MAXLEVEL) + nListLevel = MAXLEVEL - 1; + + const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(nListLevel) ); if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() ) { if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() ) |