From 540b7bf7896274109d4f589c07fd78c051bd267b Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 1 Apr 2022 18:34:30 +0200 Subject: src/appindicator.c: Fix path NULL check in status_icon_change(). Inspired by n_elements.patch by Ash Holland. Thanks. See https://bugs.launchpad.net/ubuntu/+source/libappindicator/+bug/1867996/comments/7 --- src/app-indicator.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/app-indicator.c b/src/app-indicator.c index cb0086f..3dc5937 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1619,16 +1619,18 @@ status_icon_changes (AppIndicator * self, gpointer data) gint n_elements, i; gboolean found=FALSE; gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); - for (i=0; i< n_elements || path[i] == NULL; i++) { - if(g_strcmp0(path[i], theme_path) == 0) { - found=TRUE; - break; + if (path != NULL) { + for (i=0; i< n_elements; i++) { + if(g_strcmp0(path[i], theme_path) == 0) { + found=TRUE; + break; + } } + g_strfreev (path); } if(!found) { gtk_icon_theme_append_search_path(icon_theme, theme_path); } - g_strfreev (path); } const gchar * icon_name = NULL; -- cgit v1.2.3