This is an automated email from the ASF dual-hosted git repository. jimjag pushed a commit to branch AOO50X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit a63c1033aad096ee340ad6a3b70293b16ec27547 Author: Jim Jagielski <[email protected]> AuthorDate: Mon Nov 16 07:52:29 2026 -0500 sc: stop an ODF $$ name reference from writing past the symbol buffer A reference name of 1022 characters followed by $$ skipped the length test, so loading such a formula wrote past the buffer and crashed. (cherry picked from commit 673ae46eb8d0ac467e13642a7e172b7fbc13eb00) --- main/sc/source/core/tool/compiler.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main/sc/source/core/tool/compiler.cxx b/main/sc/source/core/tool/compiler.cxx index 36ab8bcb57..5dd6327b8e 100644 --- a/main/sc/source/core/tool/compiler.cxx +++ b/main/sc/source/core/tool/compiler.cxx @@ -2344,8 +2344,17 @@ Label_MaskStateMachine: // invalid later. if (eState != ssSkipReference) { - *pSym++ = c; - *pSym++ = *pSrc++; + if (pSym > &cSymbol[ MAXSTRLEN-3 ]) + { + // two characters would step past the overflow test above + SetError( errStringOverflow); + eState = ssSkipReference; + } + else + { + *pSym++ = c; + *pSym++ = *pSrc++; + } } bAddToSymbol = false; }
