summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-08-02 09:39:43 +0100
committerMichael Stahl <mstahl@redhat.com>2017-08-07 22:37:01 +0200
commit05413fb2eace3264a1777e95c44aab3f40ca651e (patch)
tree66abd2106d926113f59ed4f5060b68e516e8730c /svl
parentd269f530cc834507f205374727c20cc5992e2213 (diff)
Resolves: ofz#2833 null deref
Change-Id: I021a716aa76d430a1d3c6fac2dddec4daa01e563 Reviewed-on: https://gerrit.libreoffice.org/40668 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforscan.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 16d5f31bd65b..e1187ffae7dd 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -2409,17 +2409,20 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
nTypeArray[i] = NF_SYMBOLTYPE_DIGIT;
OUString& rStr = sStrArray[i];
i++;
- nPos = nPos + sStrArray[i].getLength();
- nCounter++;
- while (i < nAnzStrings &&
- sStrArray[i][0] == '0')
+ if (i < nAnzStrings)
{
- rStr += sStrArray[i];
nPos = nPos + sStrArray[i].getLength();
- nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
- nAnzResStrings--;
nCounter++;
- i++;
+ while (i < nAnzStrings &&
+ sStrArray[i][0] == '0')
+ {
+ rStr += sStrArray[i];
+ nPos = nPos + sStrArray[i].getLength();
+ nTypeArray[i] = NF_SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ nCounter++;
+ i++;
+ }
}
}
else