mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 07:05:06 -05:00
Assert number of points in regress functions
This commit is contained in:
@@ -258,6 +258,9 @@ RGR_FindBestRegression
|
|||||||
int start, nruns, npoints, npoints_left;
|
int start, nruns, npoints, npoints_left;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
assert(n <= MAX_POINTS);
|
||||||
|
assert(MAX_POINTS < sizeof (critical_runs10) / sizeof (critical_runs10[0]));
|
||||||
|
|
||||||
if (n < MIN_SAMPLES_FOR_REGRESS) {
|
if (n < MIN_SAMPLES_FOR_REGRESS) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -521,6 +524,8 @@ RGR_FindBestRobustRegression
|
|||||||
double mx, dx, my, dy;
|
double mx, dx, my, dy;
|
||||||
int nruns = 0;
|
int nruns = 0;
|
||||||
|
|
||||||
|
assert(n < MAX_POINTS);
|
||||||
|
|
||||||
if (n < 2) {
|
if (n < 2) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (n == 2) {
|
} else if (n == 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user