sax/source/tools/converter.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit 1cecf9f2a44ca597a69ec12732f9b86bb1fc1aba Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Aug 23 19:34:07 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Aug 23 22:05:20 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> diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 3b390e80a60c..f1521ef1141c 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;