aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-local.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 18ae2e00af..567c5057f2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-30 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-local.c (load_metainfo): Stat the XML file before trying to
+ parse it to make sure it exists.
+
2003-05-29 Not Zed <NotZed@Ximian.com>
* Makefile.am (BUILT_SOURCES): added server_DATA (*.server) so
diff --git a/mail/mail-local.c b/mail/mail-local.c
index bf0271afb9..5db550d46d 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -136,15 +136,19 @@ static CamelType mail_local_folder_get_type (void);
static struct _local_meta *
load_metainfo(const char *path)
{
- xmlDocPtr doc;
+ xmlDocPtr doc = NULL;
xmlNodePtr node;
struct _local_meta *meta;
-
+ struct stat st;
+
d(printf("Loading folder metainfo from : %s\n", path));
meta = g_malloc0(sizeof(*meta));
meta->path = g_strdup(path);
-
+
+ if (stat (path, &st) == -1 || !S_ISREG (st.st_mode))
+ goto dodefault;
+
doc = xmlParseFile(path);
if (doc == NULL)
goto dodefault;