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

New commits:
commit ebcca36a86ed07c388221d6e9895ef132e912d00
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Apr 8 22:07:11 2024 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Apr 12 13:35:45 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/+/165937
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index 3dcdb1a4998f..f66d53d7b1b0 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<SCCOL>(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<SCROW>(nRowOverlap);
                 else
                     SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring 
rowspan: " << nRowOverlap);

Reply via email to