Mitigate bug #48050
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 4 Jul 2020 09:15:04 +0000 (11:15 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 4 Jul 2020 09:15:04 +0000 (11:15 +0200)
This bug caused an assertion failure in src/data/datasheet.c  The change here
traps the faulty condition earlier and raises a G_CRITICAL rather than an
assertion.

src/ui/gui/psppire-data-store.c

index b1f23bad2a26ee455e4619a2cae56ed18d440b8a..012c010fe61ad7b6a1b7b5df417a78e1e48545ec 100644 (file)
@@ -377,6 +377,8 @@ static void
 psppire_data_store_delete_value (PsppireDataStore *store, gint case_index)
 {
   g_return_if_fail (store->datasheet);
+  g_return_if_fail (case_index < datasheet_get_n_columns (store->datasheet));
+
   datasheet_delete_columns (store->datasheet, case_index, 1);
   datasheet_insert_column (store->datasheet, NULL, -1, case_index);
 }