From f739cc56ee5d8cbf878ea2cd232b1d93ec9d2766 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 2 Apr 2004 09:23:46 +0000 Subject: do a per-line validation of the uuencoded stuff, based on the length byte. 2004-04-02 Not Zed * em-inline-filter.c: do a per-line validation of the uuencoded stuff, based on the length byte. svn path=/trunk/; revision=25297 --- mail/ChangeLog | 3 +++ mail/em-inline-filter.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) 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 + * 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: -- cgit