EXAMINE: Fix null pointer dereference introduced in commit b46b794dfb9.
authorBen Pfaff <blp@gnu.org>
Tue, 11 Aug 2009 13:58:59 +0000 (06:58 -0700)
committerBen Pfaff <blp@gnu.org>
Tue, 11 Aug 2009 21:18:31 +0000 (14:18 -0700)
This code initializes metric->box_whisker, so it must only take its address
afterward.

src/language/stats/examine.q

index f415d0033017e7f8a510257c9541f327e7d26258..b56fad4c65bc432c93baf60b09c6c4663906bc50 100644 (file)
@@ -986,11 +986,12 @@ examine_group (struct cmd_examine *cmd, struct casereader *reader, int level,
          struct factor_metrics *metric = &result->metrics[v];
           int n_vals = caseproto_get_n_widths (casereader_get_proto (
                                                  metric->up_reader));
-          struct order_stats *os = &metric->box_whisker->parent;
+          struct order_stats *os;
 
          metric->box_whisker =
            box_whisker_create ( metric->tukey_hinges, cmd->v_id, n_vals - 1);
 
+          os = &metric->box_whisker->parent;
          order_stats_accumulate ( &os, 1,
                                  casereader_clone (metric->up_reader),
                                  wv, dependent_vars[v], MV_ANY);