From: John Darrington Date: Fri, 7 Oct 2011 11:28:19 +0000 (+0200) Subject: Fixed a crash in the oneway command X-Git-Tag: v0.7.9~127 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=089161cdd3775ea7fbcad894f4957e98ec120de5;p=pspp-builds.git Fixed a crash in the oneway command --- diff --git a/src/math/covariance.c b/src/math/covariance.c index f64e89d1..aa4a4b8a 100644 --- a/src/math/covariance.c +++ b/src/math/covariance.c @@ -356,7 +356,7 @@ covariance_accumulate_pass2 (struct covariance *cov, const struct ccase *c) cov->dim += categoricals_df_total (cov->categoricals); cov->n_cm = (cov->dim * (cov->dim - 1) ) / 2; - cov->cm = xcalloc (sizeof *cov->cm, cov->n_cm); + cov->cm = xcalloc (cov->n_cm, sizeof *cov->cm); /* Grow the moment matrices so that they're large enough to accommodate the categorical elements */ diff --git a/tests/language/stats/oneway.at b/tests/language/stats/oneway.at index ce121beb..c824d9a4 100644 --- a/tests/language/stats/oneway.at +++ b/tests/language/stats/oneway.at @@ -900,4 +900,24 @@ temperature,Assume equal variances,1,-.98,2.74,.36,6,.73 ,,3,-8.83,18.66,-.47,4.19,1.34 ]) +AT_CLEANUP + + +AT_SETUP([ONEWAY crash on single category independent variable]) +AT_DATA([crash.sps],[ +input program. +loop #i = 1 to 10. +compute test = #i. +end case. +end loop. +end file. +end input program. + +compute x = 1. + +oneway test by x. +]) + +AT_CHECK([pspp -O format=csv crash.sps], [0], [ignore]) + AT_CLEANUP \ No newline at end of file