diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2023-03-21 15:32:34 +0100 |
---|---|---|
committer | Felipe Borges <felipeborges@gnome.org> | 2023-03-21 16:37:44 +0100 |
commit | 62ec9e456f0aea2b324a292c57325ef35e1d3a24 (patch) | |
tree | f9788f3073aa76de8dfa46f87f095be0df0ff949 | |
parent | fbffbc6ae0cf66e61cee376fcba586d9a267e47e (diff) | |
download | gnome-control-center-62ec9e456f0aea2b324a292c57325ef35e1d3a24.tar.gz |
color: Do not try to access to null pointer in destruction
During destruction toolbar_devices is nullified, but
gtk_widget_in_destruction() does not perform a NULL-check, and we could
crash:
==22708== Invalid read of size 1
==22708== at 0x505CC0B: gtk_widget_in_destruction (gtkwidget.c:10643)
==22708== by 0x189553: gcm_prefs_list_box_row_selected_cb (cc-color-panel.c:1708)
==22708== by 0x4A61714: g_cclosure_marshal_VOID__OBJECTv (gmarshal.c:1910)
==22708== by 0x4A5E148: _g_closure_invoke_va (gclosure.c:895)
==22708== by 0x4A784F3: g_signal_emit_valist (gsignal.c:3462)
==22708== by 0x4A78722: g_signal_emit (gsignal.c:3612)
==22708== by 0x4F5B121: gtk_list_box_remove (gtklistbox.c:2420)
==22708== by 0x4F5B222: gtk_list_box_dispose (gtklistbox.c:439)
==22708== by 0x4A63338: g_object_unref (gobject.c:3891)
==22708== by 0x4EAA994: gtk_box_dispose (gtkbox.c:230)
==22708== by 0x4A63338: g_object_unref (gobject.c:3891)
==22708== by 0x4EAA994: gtk_box_dispose (gtkbox.c:230)
==22708== Address 0xfffffffffffffeb2 is not stack'd, malloc'd or (recently) free'd
See: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/2009913
-rw-r--r-- | panels/color/cc-color-panel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/panels/color/cc-color-panel.c b/panels/color/cc-color-panel.c index 42820c798..9af17efa7 100644 --- a/panels/color/cc-color-panel.c +++ b/panels/color/cc-color-panel.c @@ -1705,7 +1705,8 @@ static void gcm_prefs_list_box_row_selected_cb (CcColorPanel *panel, GtkListBoxRow *row) { - if (gtk_widget_in_destruction (panel->toolbar_devices)) + if (!panel->toolbar_devices || + gtk_widget_in_destruction (panel->toolbar_devices)) return; gcm_prefs_refresh_toolbar_buttons (panel); |