psppire-window: Fix use-after-free error in read_spv_file().
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 27 Dec 2020 06:16:39 +0000 (22:16 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 27 Dec 2020 06:16:39 +0000 (22:16 -0800)
commit5816109430eb4b71652de09cfdc2df2bc5c44655
tree8afe4cbcd1a3aa25002f16340a9d91737ef464de
parentb11b5d8747643a2d6f81416ed584d3de4e276990
psppire-window: Fix use-after-free error in read_spv_file().

spv_item_get_table() returns a borrowed reference, but read_spv_file()
treated it as if it owned it.  This fixes the problem.

This fixes crashes opening .spv files in PSPPIRE with File|Open.

Also, change spv_item_get_table() to return a const pointer, to make it
clearer that the reference is a borrowed one.
src/output/spv/spv.c
src/output/spv/spv.h
src/ui/gui/psppire-window.c