sax/source/tools/converter.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 001977eac8a1a27892eb447d02271086845210a4 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Aug 23 19:34:07 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Aug 25 11:02:04 2025 +0200 cid#1660010 Overflowed constant Change-Id: Ie8d50e3178713029197a1df3a80ce3319c0f77ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190107 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 1cecf9f2a44ca597a69ec12732f9b86bb1fc1aba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190144 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index f27fc325e26d..8eb334113401 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -1538,6 +1538,13 @@ static bool convertDurationHelper(util::Duration& rDuration, V string) bSuccess = false; } + if (bSuccess) + { + bSuccess = nYears >= std::numeric_limits<sal_Int16>::min() && + nYears <= std::numeric_limits<sal_Int16>::max(); + SAL_WARN_IF(!bSuccess, "sax", "convertDurationHelper: year overflow: " << nYears); + } + if (bSuccess) { rDuration.Negative = bIsNegativeDuration;