summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-10 09:42:36 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-10-12 09:54:16 +0200
commitb3b52643983ec28838eeeed9f841b0918dc745be (patch)
tree35bbaee6cef2063eec27f4de612bf1e3e7dad9bd /svl
parent3eb084243af11b1ab5b0c940d6baa42dd63d5ad1 (diff)
ofz#10879 stay inside sSecStr bounds
Change-Id: I0ca70cdb9b80305c5339668d65d2c4c9977e7160 Reviewed-on: https://gerrit.libreoffice.org/61605 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zformat.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index a1d55cbc82f9..c9bd3d814e90 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3075,7 +3075,7 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
(rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_STRING ||
rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_TIME100SECSEP) ?
nCntPost : rInfo.sStrArray[i].getLength() );
- for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost; j++)
+ for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost && nSecPos < sSecStr.getLength(); ++j)
{
sBuff.append(sSecStr[nSecPos]);
nSecPos++;
@@ -3955,7 +3955,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
(rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_STRING ||
rInfo.nTypeArray[i-1] == NF_SYMBOLTYPE_TIME100SECSEP) ?
nCntPost : rInfo.sStrArray[i].getLength() );
- for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost; j++)
+ for (sal_Int32 j = 0; j < nLen && nSecPos < nCntPost && nSecPos < sSecStr.getLength(); ++j)
{
sBuff.append(sSecStr[ nSecPos ]);
nSecPos++;