From e2f53f8dd97ca2177a60f7c7e7d785d8e3e7faaa Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 14 Oct 2018 21:06:56 +0200 Subject: [PATCH] Fix possible null pointer dereference in linreg_predict. Found by cppcheck. --- src/math/linreg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/linreg.c b/src/math/linreg.c index d1e0dae980..f88a18a5b8 100644 --- a/src/math/linreg.c +++ b/src/math/linreg.c @@ -275,11 +275,11 @@ linreg_predict (const struct linreg *c, const double *vals, size_t n_vals) size_t j; double result; - assert (n_vals == c->n_coeffs); if (vals == NULL || c == NULL) { return GSL_NAN; } + assert (n_vals == c->n_coeffs); if (c->coeff == NULL) { /* The stupid model: just guess the mean. */ -- 2.30.2