Fix bug in EXAMINE when an invalid dependent variable was specified.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 26 Mar 2016 17:34:02 +0000 (18:34 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 27 Mar 2016 12:26:29 +0000 (14:26 +0200)
Found by zzuf.

src/language/stats/examine.c
tests/language/stats/examine.at

index 20cd2f45189cd32a341f15c7b2e74e8c7367d51d..68b64116264ba3bc7099ae35304a36b0661b17c0 100644 (file)
@@ -1942,7 +1942,8 @@ cmd_examine (struct lexer *lexer, struct dataset *ds)
   examine.boxplot = false;
   examine.spreadlevelplot = false;
   examine.sl_power = 0;
-  
+  examine.dep_vars = NULL;
+  examine.n_dep_vars = 0;
   examine.dict = dataset_dict (ds);
 
   /* Accept an optional, completely pointless "/VARIABLES=" */
index d4540ba45d0a16b10c1908906d21547b81fee259..a55facf7c287e8c36a0197b4c476ac77fc753982 100644 (file)
@@ -1046,3 +1046,30 @@ EXAMINE
 AT_CHECK([pspp -o pspp.csv examine-empty-parens.sps], [1], [ignore])
 
 AT_CLEANUP 
+
+
+
+
+dnl Test for another crash which happened on bad input syntax
+AT_SETUP([EXAMINE -- Bad variable])
+
+AT_DATA([examine-bad-variable.sps], [dnl
+data list list /h * g *.
+begin data.
+3 1
+4 1
+5 2
+end data.
+
+EXAMINE
+        /VARIABLES/ h
+        BY  g
+        .
+])
+
+AT_CHECK([pspp -o pspp.csv examine-bad-variable.sps], [1], [ignore])
+
+AT_CLEANUP 
+
+
+