diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2023-01-09 00:14:21 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2023-01-09 00:14:21 +0000 |
commit | 7edf8841fb604f812cee44663810c6039260f5a2 (patch) | |
tree | 575710f69977f9191da4f7ba94803e2788226026 | |
parent | 6b5b7eab048e710fdec0a8fd3fdfd1efb25abccf (diff) | |
parent | f2593dec4b2bedf5f2d65ce02c22bbd4ffed6cf7 (diff) | |
download | gtk+-7edf8841fb604f812cee44663810c6039260f5a2.tar.gz |
Merge branch 'a11y_check_null_path' into 'main'
a11y: Avoid crashing if GtkAtSpiContext::path is NULL
See merge request GNOME/gtk!5405
-rw-r--r-- | gtk/a11y/gtkatspicache.c | 3 | ||||
-rw-r--r-- | gtk/a11y/gtkatspiroot.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gtk/a11y/gtkatspicache.c b/gtk/a11y/gtkatspicache.c index 3b16f24d6f..c24d55923f 100644 --- a/gtk/a11y/gtkatspicache.c +++ b/gtk/a11y/gtkatspicache.c @@ -444,6 +444,9 @@ gtk_at_spi_cache_remove_context (GtkAtSpiCache *self, g_return_if_fail (GTK_IS_AT_SPI_CONTEXT (context)); const char *path = gtk_at_spi_context_get_context_path (context); + if (path == NULL) + return; + if (!g_hash_table_contains (self->contexts_by_path, path)) return; diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c index b39d0938d4..78c4d7c0de 100644 --- a/gtk/a11y/gtkatspiroot.c +++ b/gtk/a11y/gtkatspiroot.c @@ -690,7 +690,8 @@ gtk_at_spi_root_constructed (GObject *gobject) /* No need to validate the path */ self->base_path = g_strconcat (app_path, "/a11y", NULL); } - else + + if (self->base_path == NULL) { const char *program_name = g_get_prgname (); |