If the filename is not encoded in UTF-8, we just ignore it for now to
2005-02-26 Rodney Dawes <dobey@novell.com> * gnome-wp-capplet.c (gnome_wp_add_image): If the filename is not encoded in UTF-8, we just ignore it for now to avoid crashing * gnome-wp-xml.c (gnome_wp_xml_load_xml): Check to make sure that the filename and name tags that we read in, aren't NULL If the filename we read in is NULL, free the item, and continue on Fixes #146130 #146645 (resolving these as dups of #168604 ) Fixes #159441
This commit is contained in:
parent
8dd93b12a7
commit
c15683e8ff
3 changed files with 27 additions and 6 deletions
|
@ -1,3 +1,15 @@
|
|||
2005-02-26 Rodney Dawes <dobey@novell.com>
|
||||
|
||||
* gnome-wp-capplet.c (gnome_wp_add_image): If the filename is not
|
||||
encoded in UTF-8, we just ignore it for now to avoid crashing
|
||||
|
||||
* gnome-wp-xml.c (gnome_wp_xml_load_xml): Check to make sure that the
|
||||
filename and name tags that we read in, aren't NULL
|
||||
If the filename we read in is NULL, free the item, and continue on
|
||||
|
||||
Fixes #146130 #146645 (resolving these as dups of #168604 )
|
||||
Fixes #159441
|
||||
|
||||
2005-02-06 Rodney Dawes <dobey@novell.com>
|
||||
|
||||
* gnome-wp-capplet.c (wallpaper_properties_init): Force using the gtk+
|
||||
|
|
|
@ -93,6 +93,9 @@ static GnomeWPItem * gnome_wp_add_image (GnomeWPCapplet * capplet,
|
|||
const gchar * filename) {
|
||||
GnomeWPItem * item;
|
||||
|
||||
if (!g_utf8_validate (filename, -1, NULL))
|
||||
return NULL;
|
||||
|
||||
item = g_hash_table_lookup (capplet->wphash, filename);
|
||||
if (item != NULL) {
|
||||
if (item->deleted) {
|
||||
|
|
|
@ -118,13 +118,13 @@ static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
|||
|
||||
for (wpa = list->children; wpa != NULL; wpa = wpa->next) {
|
||||
if (!strcmp (wpa->name, "filename")) {
|
||||
if (wpa->last != NULL) {
|
||||
if (wpa->last != NULL && wpa->last->content != NULL) {
|
||||
wp->filename = g_strdup (g_strstrip (wpa->last->content));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (!strcmp (wpa->name, "name")) {
|
||||
if (wpa->last != NULL) {
|
||||
if (wpa->last != NULL && wpa->last->content != NULL) {
|
||||
nodelang = xmlNodeGetLang (wpa->last);
|
||||
|
||||
if (wp->name == NULL && nodelang == NULL) {
|
||||
|
@ -138,6 +138,8 @@ static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
|||
}
|
||||
|
||||
xmlFree (nodelang);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else if (!strcmp (wpa->name, "imguri")) {
|
||||
if (wpa->last != NULL) {
|
||||
|
@ -169,13 +171,17 @@ static void gnome_wp_xml_load_xml (GnomeWPCapplet * capplet,
|
|||
}
|
||||
}
|
||||
|
||||
/* Make sure we don't already have this one */
|
||||
/* Make sure we don't already have this one and that filename exists */
|
||||
if (wp->filename != NULL) {
|
||||
item = g_hash_table_lookup (capplet->wphash, wp->filename);
|
||||
|
||||
if (item != NULL) {
|
||||
gnome_wp_item_free (wp);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Verify the colors and alloc some GdkColors here */
|
||||
if (wp->shade_type == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue