aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-04-22 06:15:36 +0800
committerChris Toshok <toshok@src.gnome.org>2003-04-22 06:15:36 +0800
commite5a5278df98df3dccee506b0847644055fb11905 (patch)
treebe59c871cea43e6fdfe6cb794774a389a986cb73 /shell
parent7f0a93f2ed9295a6720d96285be768adfc7403a6 (diff)
downloadgsoc2013-evolution-e5a5278df98df3dccee506b0847644055fb11905.tar.gz
gsoc2013-evolution-e5a5278df98df3dccee506b0847644055fb11905.tar.zst
gsoc2013-evolution-e5a5278df98df3dccee506b0847644055fb11905.zip
this should never happen unless you're really trying, but don't crash if
2003-04-21 Chris Toshok <toshok@ximian.com> * e-folder-list.c (e_folder_list_parse_xml): this should never happen unless you're really trying, but don't crash if the xml setting is malformed. svn path=/trunk/; revision=20912
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog6
-rw-r--r--shell/e-folder-list.c12
2 files changed, 14 insertions, 4 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index a9be31cf26..1b83ddeecd 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-21 Chris Toshok <toshok@ximian.com>
+
+ * e-folder-list.c (e_folder_list_parse_xml): this should never
+ happen unless you're really trying, but don't crash if the xml
+ setting is malformed.
+
2003-04-21 Ettore Perazzoli <ettore@ximian.com>
* e-local-storage.c (create_folder_directory): Don't signal an
diff --git a/shell/e-folder-list.c b/shell/e-folder-list.c
index 3da34b7c57..fb199be2a9 100644
--- a/shell/e-folder-list.c
+++ b/shell/e-folder-list.c
@@ -467,13 +467,19 @@ e_folder_list_init (EFolderList *efl)
EFolderListItem *
e_folder_list_parse_xml (const char *xml)
{
- xmlDoc *doc;
+ xmlDoc *doc = NULL;
xmlNode *root;
xmlNode *node;
int i;
EFolderListItem *items;
- if (xml == NULL || *xml == 0) {
+ if (xml && *xml) {
+ doc = xmlParseMemory (xml, strlen (xml));
+ if (!doc)
+ g_warning ("malformed EFolderList xml");
+ }
+
+ if (!doc) {
items = g_new (EFolderListItem, 1);
items[0].uri = NULL;
items[0].physical_uri = NULL;
@@ -481,8 +487,6 @@ e_folder_list_parse_xml (const char *xml)
return items;
}
- doc = xmlParseMemory (xml, strlen (xml));
-
root = xmlDocGetRootElement (doc);
for (node = root->xmlChildrenNode, i = 0; node; node = node->next, i++)