aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Meeks <michael@helixcode.com>2001-02-04 06:56:15 +0800
committerMichael Meeks <michael@src.gnome.org>2001-02-04 06:56:15 +0800
commit5011c8574c85d2e7630789cfaef78b3f3d3fb41a (patch)
treec8e617511f4663d6e173fa60d712e382d8b142c7
parent939160fe57ec0fa0318cb3d45bd8c039532ac27a (diff)
downloadgsoc2013-evolution-5011c8574c85d2e7630789cfaef78b3f3d3fb41a.tar
gsoc2013-evolution-5011c8574c85d2e7630789cfaef78b3f3d3fb41a.tar.gz
gsoc2013-evolution-5011c8574c85d2e7630789cfaef78b3f3d3fb41a.tar.bz2
gsoc2013-evolution-5011c8574c85d2e7630789cfaef78b3f3d3fb41a.tar.lz
gsoc2013-evolution-5011c8574c85d2e7630789cfaef78b3f3d3fb41a.tar.xz
gsoc2013-evolution-5011c8574c85d2e7630789cfaef78b3f3d3fb41a.tar.zst
gsoc2013-evolution-5011c8574c85d2e7630789cfaef78b3f3d3fb41a.zip
Fix dodgy libxml allocation pollution, and potential faults on NULL
2001-02-03 Michael Meeks <michael@helixcode.com> * mail-local.c (load_metainfo): Fix dodgy libxml allocation pollution, and potential faults on NULL attributes. svn path=/trunk/; revision=7949
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-local.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 6d4483cac2..add8de5393 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2001-02-03 Michael Meeks <michael@helixcode.com>
+
+ * mail-local.c (load_metainfo): Fix dodgy libxml allocation
+ pollution, and potential faults on NULL attributes.
+
2001-02-02 Not Zed <NotZed@Ximian.com>
* mail-send-recv.c (mail_send_receive): Cleaned up so we dont add
diff --git a/mail/mail-local.c b/mail/mail-local.c
index 22df0333d1..96e8b6c037 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -97,9 +97,16 @@ load_metainfo(const char *path)
node = node->childs;
while (node) {
if (!strcmp(node->name, "folder")) {
- char *index;
- meta->format = xmlGetProp(node, "type");
- meta->name = xmlGetProp(node, "name");
+ char *index, *txt;
+
+ txt = xmlGetProp(node, "type");
+ meta->format = g_strdup (txt ? txt : "mbox");
+ xmlFree (txt);
+
+ txt = xmlGetProp(node, "name");
+ meta->name = g_strdup (txt ? txt : "mbox");
+ xmlFree (txt);
+
index = xmlGetProp(node, "index");
if (index) {
meta->indexed = atoi(index);