From e0e04e97756092752ce96dfdbaae7ac3afbaf274 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Sat, 11 Nov 2000 04:01:14 +0000 Subject: Make sure 'atleast' is at least 1, always. This is possibly a temporary 2000-11-11 Not Zed * camel-mime-parser.c (folder_push_part): Make sure 'atleast' is at least 1, always. This is possibly a temporary fix for a bad failure mode on bad multipart messages. svn path=/trunk/; revision=6540 --- camel/camel-mime-parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c index 6b68013401..7d7737359e 100644 --- a/camel/camel-mime-parser.c +++ b/camel/camel-mime-parser.c @@ -951,7 +951,8 @@ folder_push_part(struct _header_scan_state *s, struct _header_scan_stack *h) if (s->parts && s->parts->atleast > h->boundarylenfinal) h->atleast = s->parts->atleast; else - h->atleast = h->boundarylenfinal; + /* boundarylen should never be zero, but just incase */ + h->atleast = MAX(h->boundarylenfinal, 1); h->parent = s->parts; s->parts = h; @@ -1010,8 +1011,8 @@ folder_scan_skip_line(struct _header_scan_state *s) s->atleast = atleast; - return -1; /* not found */ - } + return -1; /* not found */ +} /* TODO: Is there any way to make this run faster? It gets called a lot ... */ static struct _header_scan_stack * -- cgit v1.2.3