spv-legacy-decoder: Always give the pivot table a title.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 18 Jan 2022 03:19:27 +0000 (19:19 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 18 Jan 2022 03:19:27 +0000 (19:19 -0800)
A pivot table must have a title.  Some parts of PSPP rely on that.  The
legacy SPV decoder didn't ensure this, and one SPV in my corpus didn't have
one, which led to null pointer dereferences, so this commit fixes the
problem.

src/output/spv/spv-legacy-decoder.c

index 94d05b59f23e71bf4d89eebbb3fba9355b5dec5d..e103dd842e8247379cbfc670803c24bc9f3a8f83 100644 (file)
@@ -1771,7 +1771,8 @@ decode_spvdx_table (const struct spvdx_visualization *v, const char *subtype,
                     const struct pivot_table_look *look,
                     const struct spv_data *data, struct pivot_table **outp)
 {
-  struct pivot_table *table = pivot_table_create__ (NULL, subtype);
+  struct pivot_table *table = pivot_table_create__ (
+    pivot_value_new_user_text (v->name, SIZE_MAX), subtype);
 
   pivot_table_set_look (table, look);
   table->look = pivot_table_look_unshare (table->look);