online.git: engine/starmath

0 views
Skip to first unread message

"Caolán McNamara (via cogerrit)"

unread,
May 24, 2026, 4:40:50 PM (yesterday) May 24
to collaboraon...@googlegroups.com
engine/starmath/source/node.cxx | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 8722cc0ab4386805a1ca5afd6ae999976a105bc5
Author: Caolán McNamara <caolan....@collabora.com>
AuthorDate: Sun May 24 11:05:18 2026 +0100
Commit: Noel Grandin <noel.g...@collabora.com>
CommitDate: Sun May 24 20:40:36 2026 +0000

ofz#515065180 Integer-overflow

Signed-off-by: Caolán McNamara <caolan....@collabora.com>
Change-Id: Ic19148985d4f8929ab815ddeb8dee757ff806cfa
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3165
Reviewed-by: Noel Grandin <noel.g...@collabora.com>
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>

diff --git a/engine/starmath/source/node.cxx b/engine/starmath/source/node.cxx
index f6bf18248a25..5584ea6f72fd 100644
--- a/engine/starmath/source/node.cxx
+++ b/engine/starmath/source/node.cxx
@@ -690,7 +690,14 @@ void SmUnHorNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
pOper->Arrange(rDev, rFormat);
pBody->Arrange(rDev, rFormat);

- tools::Long nDist = (pOper->GetRect().GetWidth() * rFormat.GetDistance(DIS_HORIZONTAL)) / 100;
+ tools::Long nMul;
+ if (o3tl::checked_multiply<tools::Long>(pOper->GetRect().GetWidth(), rFormat.GetDistance(DIS_HORIZONTAL), nMul))
+ {
+ SAL_WARN("starmath", "integer overflow");
+ return;
+ }
+
+ tools::Long nDist = nMul / 100;

SmRect::operator = (*pNode0);


Reply all
Reply to author
Forward
0 new messages