From 38e062c3d842f17d7361d46d11e3ee355905988f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 2 Apr 2021 14:28:37 +0100 Subject: ofz: Segv on unknown address Change-Id: I6c69375a89781fc0b87230203335c861efb562f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113482 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sc/source/core/tool/compiler.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index fea9d46c89e2..c20f0a14d519 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2649,7 +2649,14 @@ Label_MaskStateMachine: if (eState != ssSkipReference) { *pSym++ = c; - *pSym++ = *pSrc++; + + if( pSym == &cSymbol[ MAXSTRLEN ] ) + { + SetError( FormulaError::StringOverflow); + eState = ssStop; + } + else + *pSym++ = *pSrc++; } bAddToSymbol = false; } -- cgit