chart2/source/tools/RegressionCurveCalculator.cxx | 2 ++ 1 file changed, 2 insertions(+)
New commits: commit 34b50f81ac899d8430682e6087b27de38b3333e0 Author: Noel Grandin <[email protected]> AuthorDate: Thu Feb 23 12:11:48 2023 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Feb 23 15:53:47 2023 +0000 blind fix for crashes in RegressionCurveCalculator if mPeriod is < 0, then we could crash in calculateValuesCentral Change-Id: I554b46ed7bf5b5b0a32fcf69829aa1c2c75833f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147508 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> (cherry picked from commit 37751d878b87765a4d2cfb50d0a39280c585ece1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147453 diff --git a/chart2/source/tools/RegressionCurveCalculator.cxx b/chart2/source/tools/RegressionCurveCalculator.cxx index fd2ca4329e42..8f22f9834bdc 100644 --- a/chart2/source/tools/RegressionCurveCalculator.cxx +++ b/chart2/source/tools/RegressionCurveCalculator.cxx @@ -75,6 +75,8 @@ void RegressionCurveCalculator::setRegressionProperties( sal_Int32 aPeriod, sal_Int32 nMovingType ) { + if( aPeriod < 0 ) + throw lang::IllegalArgumentException("aPeriod may not be < 0", static_cast<cppu::OWeakObject*>(this), 3); mDegree = aDegree; mForceIntercept = aForceIntercept; mInterceptValue = aInterceptValue;
