formula/source/core/api/FormulaCompiler.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 7c6117235ce4112154c416dee6f495672dab9993 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Feb 11 09:52:31 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Feb 11 12:19:02 2021 +0100 ofz#30812 protect NextToken calling NextToken with RecurseGuard and bump limit from 42 to 100 Change-Id: I0a35b32e7ab74a4148197ba48c52b6714bdb449d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110756 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 8e986de15dca..c4e037f624cd 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -1240,7 +1240,7 @@ void FormulaCompiler::AppendErrorConstant( OUStringBuffer& rBuffer, FormulaError rBuffer.append( mxSymbols->getSymbol( eOp)); } -constexpr short nRecursionMax = 42; +constexpr short nRecursionMax = 100; bool FormulaCompiler::GetToken() { @@ -2534,7 +2534,10 @@ OpCode FormulaCompiler::NextToken() // Operator and Plus => operator if (eOp == ocAdd && (eLastOp == ocOpen || eLastOp == ocSep || (SC_OPCODE_START_BIN_OP <= eLastOp && eLastOp < SC_OPCODE_STOP_UN_OP))) + { + FormulaCompilerRecursionGuard aRecursionGuard( nRecursion ); eOp = NextToken(); + } else { // Before an operator there must not be another operator, with the _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits