From 11e98a5087f39eb8ff6a0b8ce260169f213e7c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 8 Apr 2024 22:07:11 +0100 Subject: [PATCH] ofz#67906 Integer-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I459bdeef6bb7577c5388202374c981c7b01fa137 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165899 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/filter/html/htmlpars.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 4745be3526dd..83d9c01fbf7e 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1058,7 +1058,7 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo ) case HtmlOptionId::COLSPAN: { sal_Int32 nColOverlap = rOption.GetString().toInt32(); - if (nColOverlap >= 0 && nColOverlap <= SCCOL_MAX) + if (nColOverlap >= 0 && nColOverlap <= mpDoc->MaxCol()) mxActEntry->nColOverlap = static_cast(nColOverlap); else SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring colspan: " << nColOverlap); @@ -1067,7 +1067,7 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo ) case HtmlOptionId::ROWSPAN: { sal_Int32 nRowOverlap = rOption.GetString().toInt32(); - if (nRowOverlap >= 0) + if (nRowOverlap >= 0 && nRowOverlap <= mpDoc->MaxRow()) mxActEntry->nRowOverlap = static_cast(nRowOverlap); else SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring rowspan: " << nRowOverlap);