summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-02 14:28:37 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-04-06 12:26:55 +0200
commit38e062c3d842f17d7361d46d11e3ee355905988f (patch)
tree30faa22683b133eea1900674cd6c9ad39d304936
parent2481c7f308e0a30108fa7a8eedb05e34c457e0d9 (diff)
ofz: Segv on unknown address
Change-Id: I6c69375a89781fc0b87230203335c861efb562f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113482 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sc/source/core/tool/compiler.cxx9
1 files changed, 8 insertions, 1 deletions
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;
}