Mimeparser rewrite; fix bug detecting trailing MIME-Boundary
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 15 Jan 2011 15:14:16 +0000 (16:14 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 15 Jan 2011 15:14:16 +0000 (16:14 +0100)
  - when searching for the '--' after the mime boundary to detect whether its the last, we had an off by one. fixed.

libcitadel/lib/mime_parser.c

index 86905f1ee60fe54cd93cf624937f7de988e8ccef..f2aec777ab1b41774aed4cc5ed946fed9197ab79 100644 (file)
@@ -680,8 +680,8 @@ static void recurseable_mime_parser(char *partnum,
                        if (next_boundary != NULL) {
                                /* If we pass out of scope, don't attempt to
                                 * read past the end boundary. */
-                               if ((*(next_boundary + m->b[startary].len + 1) == '-') && 
-                                   (*(next_boundary + m->b[startary].len + 2) == '-') ){
+                               if ((*(next_boundary + m->b[startary].len) == '-') && 
+                                   (*(next_boundary + m->b[startary].len + 1) == '-') ){
                                        ptr = content_end;
                                }
                                else {