sc/source/filter/html/htmlpars.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6c20494f3ee1ea4bad451964725dfc30366d783b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Apr 8 22:07:11 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Apr 12 15:12:01 2024 +0200

    ofz#67906 Integer-overflow
    
    Change-Id: I459bdeef6bb7577c5388202374c981c7b01fa137
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165899
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165936
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index e6b7daa3767b..29c17f71e28e 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -924,7 +924,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<SCCOL>(nColOverlap);
                 else
                     SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring 
colspan: " << nColOverlap);
@@ -933,7 +933,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<SCROW>(nRowOverlap);
                 else
                     SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring 
rowspan: " << nRowOverlap);

Reply via email to