aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Loper <mloper@src.gnome.org>2000-07-27 05:02:08 +0800
committerMatthew Loper <mloper@src.gnome.org>2000-07-27 05:02:08 +0800
commited21f552bbad288dd7963f859df11870509cbc27 (patch)
tree0ff5b6c36e0a8c6b0ebe336c020f7e0224314009
parent490437a88464f7be839ae646970e3219b04b1562 (diff)
downloadgsoc2013-evolution-ed21f552bbad288dd7963f859df11870509cbc27.tar.gz
gsoc2013-evolution-ed21f552bbad288dd7963f859df11870509cbc27.tar.zst
gsoc2013-evolution-ed21f552bbad288dd7963f859df11870509cbc27.zip
Make the mime parser a bit less reckless. More reckful?
svn path=/trunk/; revision=4365
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/camel-mime-parser.c3
-rw-r--r--camel/camel-mime-utils.c4
3 files changed, 13 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index e5c0848a37..6483bbcedf 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,12 @@
+2000-07-26 Peter Williams <peterw@helixcode.com>
+
+ * camel-mime-parser.c (folder_scan_init): Initialize
+ outbuf to be "" -- it's not guaranteed to be zeroed.
+
+ * camel-mime-utils.c (header_references_decode): Return
+ if the header is NULL -> or "" <-. Don't do our stupid
+ mailer trick if we point to \0.
+
2000-07-26 Dan Winship <danw@helixcode.com>
* camel-movemail.c (movemail_external): routine to call an
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index 9e49effa6c..5917cfda2a 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -1152,7 +1152,7 @@ retry:
}
/* we always have at least _1_ char here ... */
- if (s->outptr[-1] == '\n')
+ if (s->outptr > s->outbuf && s->outptr[-1] == '\n')
s->outptr--;
s->outptr[0] = 0;
@@ -1383,6 +1383,7 @@ folder_scan_init(void)
s->stream = NULL;
s->outbuf = g_malloc(1024);
+ s->outbuf[0] = '\0';
s->outptr = s->outbuf;
s->outend = s->outbuf+1024;
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 18c8aa2408..e6b7e0350b 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -1747,7 +1747,7 @@ header_references_decode(const char *in)
struct _header_references *head = NULL, *node;
char *id, *word;
- if (in == NULL)
+ if (in == NULL || in[0] == '\0')
return NULL;
while (*inptr) {
@@ -1764,7 +1764,7 @@ header_references_decode(const char *in)
word = header_decode_word(&inptr);
if (word)
g_free (word);
- else
+ else if (*inptr != '\0')
inptr++; /* Stupid mailer tricks */
}
}