Web lists-archives.com

[PATCH] Fix null character check for the first element of data->group




Additionaly add check for NULL pointer.
data->group is "ghar **" array.
From 5b467dc82a0d051821ce33de1a8edeb828ad3cd2 Mon Sep 17 00:00:00 2001
From: Maks Naumov <maksqwe1@ukr.net>
Date: Sun, 11 Jan 2015 08:26:09 -0800
Subject: [PATCH] Fix null character check for the first element of data->group

Additionaly add check for NULL pointer.
data->group is "ghar **" array.

Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
---
 gtk/gtkrecentmanager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index 471f6d8..b3f58a3 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -976,7 +976,7 @@ gtk_recent_manager_add_full (GtkRecentManager    *manager,
 
   g_bookmark_file_set_mime_type (priv->recent_items, uri, data->mime_type);
 
-  if (data->groups && data->groups[0] != '\0')
+  if (data->groups && data->groups[0] != NULL && *data->groups[0] != '\0')
     {
       gint j;
 
-- 
2.1.0

_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-devel-list