Kaydet (Commit) ded55489 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

fix assert with invalid sting length

Change-Id: Ie6730283b0dcecc0746cc15d093ff58ba187cff1
üst fadbb2e7
......@@ -8071,7 +8071,10 @@ void ScInterpreter::ScMid()
if (fAnfang < 1.0 || fAnz < 0.0 || fAnfang > double(STRING_MAXLEN) || fAnz > double(STRING_MAXLEN))
PushIllegalArgument();
else
PushString(aStr.copy(static_cast<sal_Int32>(fAnfang-1), static_cast<sal_Int32>(fAnz)));
{
sal_Int32 nCharacters = std::min<sal_Int32>(static_cast<sal_Int32>(fAnz), aStr.getLength() - fAnfang + 1);
PushString(aStr.copy(static_cast<sal_Int32>(fAnfang-1), nCharacters));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment