projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75613d7
)
Fix possible null pointer dereference in linreg_predict.
author
John Darrington
<john@darrington.wattle.id.au>
Sun, 14 Oct 2018 19:06:56 +0000
(21:06 +0200)
committer
John Darrington
<john@darrington.wattle.id.au>
Sun, 14 Oct 2018 19:06:56 +0000
(21:06 +0200)
Found by cppcheck.
src/math/linreg.c
patch
|
blob
|
history
diff --git
a/src/math/linreg.c
b/src/math/linreg.c
index d1e0dae980e1e12c03e312b0fcbf7fd6139b6fb7..f88a18a5b804fa5861c7c45d5762e375c43274ed 100644
(file)
--- 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. */