Philip Withnall
5f5667b2a0
gmenuexporter: Fix a NULL pointer dereference on an error handling path
...
This latent bug wasn’t triggered until commit 3f30ec86c (or its
cherry-pick onto `glib-2-80`, 747e3af99, which was first released in
2.80.1).
That change means that `g_menu_exporter_free()` is now called on the
registration failure path by `g_dbus_connection_register_object()`
before it returns. The caller then tries to call `g_slice_free()` on the
exporter again. The call to `g_menu_exporter_free()` tries to
dereference/free members of the exporter which it expects to be
initialised — but because this is happening in an error handling path,
they are not initialised.
If it were to get any further, the `g_slice_free()` would then be a
double-free on the exporter allocation.
Fix that by making `g_menu_exporter_free()` robust to some of the
exporter members being `NULL`, and moving some of the initialisation
code higher in `g_dbus_connection_export_menu_model()`, and removing the
duplicate free code on the error handling path.
This includes a unit test.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes : #3366
2024-05-16 12:19:57 +01:00
..
2022-01-07 11:27:56 -06:00
2023-05-10 10:56:44 +07:00
2024-03-13 03:32:56 +05:30
2022-10-13 20:53:56 -04:00
2022-09-20 11:30:02 -04:00
2020-11-15 17:34:27 +01:00
2023-10-02 17:17:24 +01:00
2022-09-13 02:44:25 +02:00
2022-12-12 15:58:13 +01:00
2020-06-10 09:48:02 +01:00
2024-01-18 15:22:30 +00:00
2023-11-27 14:15:36 +00:00
2023-04-20 16:37:32 +02:00
2023-10-03 09:10:21 +01:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2023-05-22 22:44:52 +02:00
2022-11-02 12:34:19 +00:00
2022-12-15 19:30:43 +01:00
2024-02-06 14:06:45 +00:00
2023-11-13 12:14:01 +00:00
2022-12-13 14:07:58 +00:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2023-10-12 11:45:03 +02:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2022-12-19 12:45:02 +00:00
2022-05-18 09:20:07 +01:00
2023-08-03 09:16:26 -05:00
2022-06-21 12:50:31 +01:00
2024-01-23 21:35:54 -08:00
2024-01-18 15:22:30 +00:00
2021-05-13 20:16:46 +00:00
2020-11-14 19:03:18 +00:00
2023-11-06 15:04:01 +03:00
2023-01-17 21:08:49 +01:00
2023-01-17 21:08:49 +01:00
2022-12-09 10:45:21 +00:00
2022-12-08 05:21:19 +01:00
2023-12-20 19:23:40 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-11-02 12:34:19 +00:00
2023-10-03 09:32:44 +01:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2021-05-13 20:16:46 +00:00
2021-05-13 20:16:46 +00:00
2024-02-09 10:04:14 +00:00
2023-05-22 22:44:52 +02:00
2024-02-09 10:04:14 +00:00
2022-06-23 10:47:13 +01:00
2022-11-23 11:15:20 +00:00
2023-03-13 11:21:17 +00:00
2022-11-23 11:15:20 +00:00
2023-08-16 14:31:40 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-11-23 11:15:20 +00:00
2023-05-02 13:42:54 +02:00
2024-05-07 23:16:01 +00:00
2021-05-13 20:16:46 +00:00
2022-11-23 11:15:20 +00:00
2021-04-15 10:19:29 +02:00
2020-10-01 16:32:50 +01:00
2021-05-13 20:16:46 +00:00
2023-01-31 11:44:44 +00:00
2023-03-20 13:03:04 +00:00
2021-04-23 10:43:05 +02:00
2021-04-23 10:43:05 +02:00
2021-05-13 20:16:46 +00:00
2021-05-13 20:16:46 +00:00
2022-11-23 11:15:20 +00:00
2024-04-26 10:33:03 +01:00
2022-11-23 11:15:20 +00:00
2022-11-23 11:15:20 +00:00
2022-12-16 10:28:50 +00:00
2022-11-23 11:15:20 +00:00
2022-06-23 10:47:13 +01:00
2022-11-23 11:15:20 +00:00
2022-05-18 09:20:07 +01:00
2022-09-02 21:21:34 +02:00
2022-11-23 11:15:20 +00:00
2022-11-23 11:15:20 +00:00
2022-11-23 11:15:20 +00:00
2024-05-06 22:44:09 +01:00
2022-07-18 19:39:41 +01:00
2023-12-11 12:50:52 +00:00
2022-11-10 14:25:47 +00:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2024-05-01 15:19:33 +01:00
2023-12-05 15:58:45 +00:00
2022-11-23 11:15:20 +00:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2023-01-17 21:08:49 +01:00
2022-11-23 11:15:20 +00:00
2020-11-17 15:50:07 +00:00
2022-06-28 11:19:21 +01:00
2021-11-17 14:40:38 +01:00
2023-11-08 10:29:43 +00:00
2022-11-07 11:30:32 +00:00
2023-01-06 11:46:01 +00:00
2024-05-16 12:19:57 +01:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2022-07-25 22:30:22 +01:00
2022-06-23 10:47:13 +01:00
2024-05-15 12:59:28 +01:00
2022-05-18 09:20:07 +01:00
2023-11-01 17:56:48 +00:00
2023-10-26 10:54:34 +02:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2023-05-22 22:44:52 +02:00
2022-06-01 12:44:23 +01:00
2021-05-13 20:16:46 +00:00
2022-11-02 12:34:19 +00:00
2022-11-02 12:34:19 +00:00
2023-02-16 13:50:15 +00:00
2020-06-12 15:01:08 +01:00
2022-10-27 14:50:48 +01:00
2022-11-02 12:34:19 +00:00
2024-01-23 11:02:48 +00:00
2024-01-30 07:38:13 +00:00
2022-05-18 09:20:07 +01:00
2022-11-02 12:34:19 +00:00
2022-07-15 22:07:03 +02:00
2024-05-01 15:19:33 +01:00
2021-04-15 10:19:29 +02:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2022-05-18 09:20:07 +01:00
2023-08-14 09:32:43 +01:00
2022-06-01 12:44:23 +01:00
2022-05-18 09:20:07 +01:00
2022-07-15 22:07:03 +02:00
2021-06-04 12:09:24 +00:00
2019-12-17 20:59:22 +08:00
2023-08-03 09:16:26 -05:00
2022-11-02 12:34:19 +00:00
2023-01-27 11:58:56 +03:00
2023-10-02 15:00:23 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2022-11-24 20:03:39 +01:00
2023-05-30 12:28:45 +01:00
2023-05-30 12:28:45 +01:00
2023-05-30 12:28:45 +01:00
2023-05-30 12:28:45 +01:00
2024-01-23 11:02:48 +00:00
2024-01-23 11:02:48 +00:00
2022-05-18 09:20:07 +01:00
2023-12-20 16:14:57 +00:00
2022-05-18 09:20:07 +01:00
2021-04-29 12:40:05 +02:00
2024-02-09 10:05:56 +00:00
2023-04-27 12:23:25 +01:00
2022-10-13 20:53:56 -04:00
2024-01-13 19:54:28 +00:00
2022-11-24 20:03:39 +01:00
2021-05-13 20:16:46 +00:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2023-04-29 21:48:03 +03:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2023-04-29 21:48:03 +03:00
2023-04-29 21:48:03 +03:00
2024-01-15 14:16:21 +00:00
2022-11-02 12:34:19 +00:00
2022-06-01 12:44:23 +01:00
2023-11-02 17:49:31 +00:00
2020-11-17 15:50:07 +00:00
2023-12-20 16:14:57 +00:00
2020-06-12 15:01:08 +01:00
2023-06-30 22:59:37 +02:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2022-05-18 09:20:07 +01:00
2022-06-01 12:44:23 +01:00
2020-11-14 19:03:18 +00:00
2023-03-15 14:45:10 +00:00
2022-11-02 12:34:19 +00:00
2022-06-23 10:47:13 +01:00
2022-05-18 09:20:07 +01:00
2022-05-18 09:20:07 +01:00
2023-12-20 16:14:57 +00:00
2022-06-01 12:44:23 +01:00
2023-08-16 14:31:40 +01:00
2022-05-18 09:20:07 +01:00
2022-11-02 12:34:19 +00:00
2023-08-29 11:22:43 +01:00
2020-06-10 09:48:02 +01:00
2022-11-02 12:34:19 +00:00
2023-10-12 11:32:03 +02:00