summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-10 09:42:36 +0100
committerAndras Timar <andras.timar@collabora.com>2019-08-22 12:33:11 +0200
commit3baa1fe0569fd49514e2625af6d1a0fb1ccc4e4c (patch)
tree3811ac497bedc213688c24833b32da5e667ce7f8
parent31965ff838346d447fbeb1324f41bdd3cd992269 (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> (cherry picked from commit b3b52643983ec28838eeeed9f841b0918dc745be)
-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 103da063321f..6898de9af8d9 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3088,7 +3088,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++;
@@ -3881,7 +3881,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++;