REGRESSION: Avoid use-after-free error with TEMPORARY and SAVE.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 21 May 2013 05:20:18 +0000 (22:20 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 21 May 2013 06:03:57 +0000 (23:03 -0700)
This should fix the use-after-free error, although I am not sure whether it
makes REGRESSION do exactly what it should do.

Bug #38787.

src/language/stats/regression.c

index 282a252fdd248c646dab458019ab4112880020ea..b63b28e876c8727291c7d0f6ded96848b15dd7d0 100644 (file)
@@ -388,6 +388,13 @@ cmd_regression (struct lexer *lexer, struct dataset *ds)
 
   regression.models = xcalloc (regression.n_dep_vars, sizeof *regression.models);
 
+  if (regression.pred || regression.resid)
+    {
+      if (proc_make_temporary_transformations_permanent (ds))
+        msg (SW, _("REGRESSION with SAVE ignores TEMPORARY.  "
+                   "Temporary transformations will be made permanent."));
+    }
+
   {
     struct casegrouper *grouper;
     struct casereader *group;