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
This commit is contained in:
Eike Rathke
2015-04-29 18:57:16 +02:00
parent 969dab55bb
commit d6635af318

View File

@@ -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] == '"' )
{