cid#1660010 Overflowed constant

Change-Id: Ie8d50e3178713029197a1df3a80ce3319c0f77ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190107
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2025-08-23 22:05:20 +02:00
parent 864bd25ae1
commit 1cecf9f2a4
+7
View File
@@ -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;