diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-10 09:42:36 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-08-05 14:28:52 +0200 |
commit | bbb5a6aa2b0c1d9eb7fce7f4a08784635e44d354 (patch) | |
tree | dfb30af2955a8f7a992667d458b2bfe46bf576b2 | |
parent | ofz#10523 guard aginst 0 pF->nLCode (diff) | |
download | core-bbb5a6aa2b0c1d9eb7fce7f4a08784635e44d354.tar.gz core-bbb5a6aa2b0c1d9eb7fce7f4a08784635e44d354.zip |
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.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 6e740b3f4df0..5552fd983d33 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2899,7 +2899,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++; @@ -3689,7 +3689,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++; |