formula/source/ui/dlg/FormulaHelper.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit d63406ec35ce3d22b8f3e78b46c46dd71b6b91e4 Author: Eike Rathke <er...@redhat.com> Date: Mon Mar 30 21:29:46 2015 +0200 Resolves: tdf#90301 string access out of bounds Apparently yet another leftover of UniString to OUString conversion where with UniString out-of-bounds accesses didn't harm and returned NIL. (cherry picked from commit eed393039a9067f7a1a318934ff1c5ff90bfe443) Include <algorithm> for std::min() (cherry picked from commit 3394ac816a573030feda145dbdabd2a1eabd78c4) 13ed47d23ed4b94501d9445555d99ce08af94698 Change-Id: Id88456a52df3fc8cdaf90d9d509e327b96269808 Reviewed-on: https://gerrit.libreoffice.org/15074 Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 6c999bd..9d9bda1 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <algorithm> + #include "formula/formulahelper.hxx" #include <unotools/charclass.hxx> #include <unotools/syslocale.hxx> @@ -201,7 +203,7 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString& rFormula, return nStart; sal_Int32 nFStart = FUNC_NOTFOUND; - sal_Int32 nParPos = nStart; + sal_Int32 nParPos = bBack ? ::std::min( nStart, nStrLen - 1) : nStart; bool bRepeat, bFound; do _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits