From 64837f243f12b45f72bb4de1674fbf4e5569f8b7 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Thu, 15 Jul 2004 13:58:51 +0000 Subject: [PATCH] Check that item->fileinfo is not NULL, before trying to use a string 2004-07-15 Rodney Dawes * gnome-wp-item.c (gnome_wp_item_new): Check that item->fileinfo is not NULL, before trying to use a string variable inside the struct for a strncmp Fixes #147373 --- capplets/background/ChangeLog | 8 ++++++++ capplets/background/gnome-wp-item.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/capplets/background/ChangeLog b/capplets/background/ChangeLog index 179d8bc28..cec9d0155 100644 --- a/capplets/background/ChangeLog +++ b/capplets/background/ChangeLog @@ -1,3 +1,11 @@ +2004-07-15 Rodney Dawes + + * gnome-wp-item.c (gnome_wp_item_new): + Check that item->fileinfo is not NULL, before trying to use a + string variable inside the struct for a strncmp + + Fixes #147373 + 2004-06-28 Rodney Dawes * *.[ch]: Update copyright info to have correct years (2003-2004) diff --git a/capplets/background/gnome-wp-item.c b/capplets/background/gnome-wp-item.c index caf91a5e6..453947e99 100644 --- a/capplets/background/gnome-wp-item.c +++ b/capplets/background/gnome-wp-item.c @@ -53,7 +53,8 @@ GnomeWPItem * gnome_wp_item_new (const gchar * filename, item->pcolor = gdk_color_copy (&color1); item->scolor = gdk_color_copy (&color2); - if (!strncmp (item->fileinfo->mime_type, "image/", strlen ("image/"))) { + if (item->fileinfo != NULL && + !strncmp (item->fileinfo->mime_type, "image/", strlen ("image/"))) { if (item->name == NULL) { item->name = g_strdup (item->fileinfo->name); }