chart2/source/tools/RegressionCurveCalculator.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 37751d878b87765a4d2cfb50d0a39280c585ece1
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Feb 23 12:11:48 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Feb 23 12:15:31 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 <noel.gran...@collabora.co.uk>

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;

Reply via email to