aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog3
-rw-r--r--mail/em-inline-filter.c17
2 files changed, 20 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 51fe50a9bd..25511a491b 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,8 @@
2004-04-02 Not Zed <NotZed@Ximian.com>
+ * em-inline-filter.c: do a per-line validation of the uuencoded
+ stuff, based on the length byte.
+
** See bug #56338.
* em-format-html.c (emfh_gethttp): fix the fugly "load http if"
diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c
index fc3752fef5..1144cff503 100644
--- a/mail/em-inline-filter.c
+++ b/mail/em-inline-filter.c
@@ -224,6 +224,23 @@ emif_scan(CamelMimeFilter *f, char *in, size_t len, int final)
emif_add_part(emif, data_start, inptr-data_start);
data_start = inptr;
emif->state = EMIF_PLAIN;
+ } else {
+ int len, linelen;
+
+ /* check the length byte matches the data, if not, output what we have and re-scan this line */
+ len = ((start[0] - ' ') & 077) * 4 / 3;
+ linelen = inptr-start-1;
+ while (linelen > 0 && (start[linelen] == '\r' || start[linelen] == '\n'))
+ linelen--;
+ linelen--;
+ if (linelen != len) {
+ inptr[-1] = '\n';
+ emif_add_part(emif, data_start, start-data_start);
+ data_start = start;
+ inptr = start;
+ emif->state = EMIF_PLAIN;
+ continue;
+ }
}
break;
case EMIF_BINHEX: