diff options
author | Eike Rathke <erack@redhat.com> | 2013-02-21 18:56:29 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-02-21 18:58:44 +0100 |
commit | b9a51c0b1e000865921e0bd4b84827e6f6f12556 (patch) | |
tree | caaa3a3723548f47bec45624a6413c1de64b9258 /sc | |
parent | prevent out-of-bounds access for old binary non-UNO add-in function (diff) | |
download | core-b9a51c0b1e000865921e0bd4b84827e6f6f12556.tar.gz core-b9a51c0b1e000865921e0bd4b84827e6f6f12556.zip |
assert "can't happen"
Change-Id: I896e29b04568b351517612a1ac161dca5717dfbc
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 7326497912ab..9279c18aa2e7 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2575,6 +2575,9 @@ void ScInterpreter::ScRoman() if( (nDigit % 5) == 4 ) { + // assert can't happen with nVal<4000 precondition + assert( ((nDigit == 4) ? (nIndex >= 1) : (nIndex >= 2))); + sal_uInt16 nIndex2 = (nDigit == 4) ? nIndex - 1 : nIndex - 2; sal_uInt16 nSteps = 0; while( (nSteps < nMode) && (nIndex < nMaxIndex) ) @@ -2593,7 +2596,11 @@ void ScInterpreter::ScRoman() else { if( nDigit > 4 ) + { + // assert can't happen with nVal<4000 precondition + assert( nIndex >= 1 ); aRoman += pChars[ nIndex - 1 ]; + } sal_Int32 nPad = nDigit % 5; if (nPad) { |