From: Wilfried Goesgens Date: Sun, 6 Nov 2011 19:46:42 +0000 (+0100) Subject: Mimeparser: skip all empty lines between mimeparts not just one. X-Git-Tag: v8.11~394 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=7ddae4c51c1443ac6fc23a4646b46e34c3cbc9e2 Mimeparser: skip all empty lines between mimeparts not just one. - this makes us more robust. --- diff --git a/libcitadel/lib/mime_parser.c b/libcitadel/lib/mime_parser.c index 986c30544..11f2a27cf 100644 --- a/libcitadel/lib/mime_parser.c +++ b/libcitadel/lib/mime_parser.c @@ -626,16 +626,14 @@ static void recurseable_mime_parser(char *partnum, /* Figure out where the boundaries are */ m->b[startary].len = snprintf(m->b[startary].Key, SIZ, "--%s", m->b[boundary].Key); SubMimeHeaders = InitInterestingMimes (); - if (*ptr == '\r') - ptr ++; - if (*ptr == '\n') - ptr ++; + + while ((*ptr == '\r') || (*ptr == '\n')) ptr ++; + if (strncmp(ptr, m->b[startary].Key, m->b[startary].len) == 0) ptr += m->b[startary].len; - if (*ptr == '\r') - ptr ++; - if (*ptr == '\n') - ptr ++; + + while ((*ptr == '\r') || (*ptr == '\n')) ptr ++; + part_start = NULL; do { char *optr;