diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-03-29 19:53:17 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-04-02 13:59:32 +0200 |
commit | 17467f5956a13c5fcee27507ea60d15cdda473ed (patch) | |
tree | 353b8db56a6cb53986ac2943bf3ff72984db0fa3 | |
parent | f53df0c693d8e73e86ddd986e5b861a0af28e62b (diff) |
ofz#67708 ignore oversized colspansco-23.05.10-1
that can't fit in SCCOL
ignore negative colspan and rowspans too
Change-Id: I79a010bcd7d9d84de70f6dac2e09614d6d448227
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165481
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 72487ec8b66e..c90cc1be4ad7 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1041,12 +1041,20 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo ) { case HtmlOptionId::COLSPAN: { - mxActEntry->nColOverlap = static_cast<SCCOL>(rOption.GetString().toInt32()); + sal_Int32 nColOverlap = rOption.GetString().toInt32(); + if (nColOverlap >= 0 && nColOverlap <= SCCOL_MAX) + mxActEntry->nColOverlap = static_cast<SCCOL>(nColOverlap); + else + SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring colspan: " << nColOverlap); } break; case HtmlOptionId::ROWSPAN: { - mxActEntry->nRowOverlap = static_cast<SCROW>(rOption.GetString().toInt32()); + sal_Int32 nRowOverlap = rOption.GetString().toInt32(); + if (nRowOverlap >= 0) + mxActEntry->nRowOverlap = static_cast<SCROW>(nRowOverlap); + else + SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring rowspan: " << nRowOverlap); } break; case HtmlOptionId::ALIGN: |