From: Ben Pfaff Date: Tue, 11 Aug 2009 13:58:59 +0000 (-0700) Subject: EXAMINE: Fix null pointer dereference introduced in commit b46b794dfb9. X-Git-Tag: sid-i386-build98~4 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ece48101c54930c528980a980ee070d9c77971c2;p=pspp-builds.git EXAMINE: Fix null pointer dereference introduced in commit b46b794dfb9. This code initializes metric->box_whisker, so it must only take its address afterward. --- diff --git a/src/language/stats/examine.q b/src/language/stats/examine.q index f415d003..b56fad4c 100644 --- a/src/language/stats/examine.q +++ b/src/language/stats/examine.q @@ -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);