summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-04-29 18:57:16 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-30 04:09:01 +0000
commit121a2c44c90004300b41bee1492c614dc0fe57aa (patch)
treec1803a3955a8f26edb2131a9b7161208720a9fd7 /formula
parente839377f55d2c7f58eabf01c1609e49dff827a3a (diff)
string access out of bounds
This convoluted logic may pass FUNC_NOTFOUND -1 as position around if there was no initial function. Change-Id: I217fc745d8e0b8e532642d0f69110371d183610d (cherry picked from commit d6635af3186314de0c20a904b36e50bba4ae63cd) Reviewed-on: https://gerrit.libreoffice.org/15570 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'formula')
-rw-r--r--formula/source/ui/dlg/FormulaHelper.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx
index 9d9bda1e4fc6..c6448560f43d 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -229,7 +229,7 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString& rFormula,
}
else
{
- while ( !bFound && (nParPos < nStrLen) )
+ while ( !bFound && (0 <= nParPos && nParPos < nStrLen) )
{
if ( rFormula[nParPos] == '"' )
{