aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2000-06-14 13:10:57 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-14 13:10:57 +0800
commitabdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae (patch)
tree834d45054e39e3f9096ce96188b46383bcc3c134 /camel
parent477a592e59c0ff8850c01edf56033f14ce166abe (diff)
downloadgsoc2013-evolution-abdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae.tar
gsoc2013-evolution-abdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae.tar.gz
gsoc2013-evolution-abdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae.tar.bz2
gsoc2013-evolution-abdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae.tar.lz
gsoc2013-evolution-abdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae.tar.xz
gsoc2013-evolution-abdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae.tar.zst
gsoc2013-evolution-abdfcfcfe2f4fb79a05bd0e2def3d65a668e96ae.zip
updated the crlf filter:
encoder: allocate more memory (3 * len instead of 2 * len) decoder: prevent p from pointing beyond the end of the buffer svn path=/trunk/; revision=3561
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/camel-mime-filter-crlf.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 964eab8fb6..d5e69538e3 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,9 @@
2000-06-14 Jeffrey Stedfast <fejj@helixcode.com>
+ * camel-mime-filter-crlf.c (filter): Updated the encoder to allocate more
+ memory (since we are also now adding dots). Also updated the decoder as we
+ have found that it sometimes passes the end of the buffer.
+
* providers/pop3/camel-pop3-folder.c (get_message_by_uid): Took out the
filter code ( we already filter in camel_pop3_command_get_additional_data)
diff --git a/camel/camel-mime-filter-crlf.c b/camel/camel-mime-filter-crlf.c
index 5cc409d554..8e3ff2175c 100644
--- a/camel/camel-mime-filter-crlf.c
+++ b/camel/camel-mime-filter-crlf.c
@@ -76,7 +76,7 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
do_dots = crlf->mode == CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS;
if (crlf->direction == CAMEL_MIME_FILTER_CRLF_ENCODE) {
- camel_mime_filter_set_size (f, 2 * len, FALSE);
+ camel_mime_filter_set_size (f, 3 * len, FALSE);
p = in;
q = f->outbuf;
@@ -96,29 +96,29 @@ filter (CamelMimeFilter *f, char *in, size_t len, size_t prespace,
while (p < in + len) {
if (*p == '\r') {
crlf->saw_cr = TRUE;
- p++;
} else {
if (crlf->saw_cr) {
if (*p != '\n')
*q++ = '\r';
crlf->saw_cr = FALSE;
}
- *q++ = *p++;
+ *q++ = *p;
}
if (do_dots) {
if (*p == '.' && *(p - 1) == '\n') {
crlf->saw_dot = TRUE;
- p++;
} else {
if (crlf->saw_dot) {
if (*p == '.')
p++;
crlf->saw_dot = FALSE;
}
- *q++ = *p++;
+ *q++ = *p;
}
}
+
+ p++;
}
}