sc/source/filter/html/htmlpars.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 57f4581e326453ebed8fe688ade924804aae46dd Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Apr 19 17:20:25 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Apr 20 17:09:51 2024 +0200 ofz#68081 Use-of-uninitialized-value Change-Id: If632bd8d503f5e8c9acdab912ac0bc8a00dfd534 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166308 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index a09adb8c46eb..cba641f5136f 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -437,7 +437,9 @@ bool ScHTMLLayoutParser::SeekOffset( const ScHTMLColOffset* pOffset, sal_uInt16 OSL_ENSURE( pOffset, "ScHTMLLayoutParser::SeekOffset - illegal call" ); ScHTMLColOffset::const_iterator it = pOffset->find( nOffset ); bool bFound = it != pOffset->end(); - sal_uInt16 nPos = it - pOffset->begin(); + size_t nPos = it - pOffset->begin(); + if (nPos > o3tl::make_unsigned(std::numeric_limits<SCCOL>::max())) + return false; *pCol = static_cast<SCCOL>(nPos); if ( bFound ) return true;