From 37a80e0a4566d0f3f1f8d6468ef3fbf7ba458cd8 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 6 Nov 2011 20:46:42 +0100 Subject: [PATCH] Mimeparser: skip all empty lines between mimeparts not just one. - this makes us more robust. --- libcitadel/lib/mime_parser.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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; -- 2.30.2