pivot-table: Don't allow data cells for nonexistent categories.
[pspp] / src / output / pivot-table.c
index 5c6467147300d43c0c98720c28a9b25ecaaecab8..4c1b2c752212981d9a61c98c82c594f8446d3dd4 100644 (file)
@@ -1057,6 +1057,8 @@ pivot_table_put (struct pivot_table *table, const size_t *dindexes, size_t n,
                  struct pivot_value *value)
 {
   assert (n == table->n_dimensions);
+  for (size_t i = 0; i < n; i++)
+    assert (dindexes[i] < table->dimensions[i]->n_leaves);
 
   if (value->type == PIVOT_VALUE_NUMERIC && !value->numeric.format.w)
     {