From: Wilfried Göesgens Date: Thu, 4 Mar 2010 23:19:24 +0000 (+0000) Subject: * fix off by one while copying email headers X-Git-Tag: v7.86~337 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=0d09c9b84c6d3aaed8dd784a7af6a044029829d0 * fix off by one while copying email headers * check for CRLF regardles of what the caller is telling us, we did it like that in advance too. --- diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 14439a6ab..ce8337f85 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -574,7 +574,7 @@ int convert_field(struct CtdlMessage *msg, const char *beg, const char *end) { * ( key + (colonpos - beg) ) = '\0'; value = &key[(colonpos - beg) + 1]; unfold_rfc822_field(&value, &valueend); - valuelen = valueend - value; + valuelen = valueend - value + 1; /* * Here's the big rfc822-to-citadel loop. diff --git a/citadel/msgbase.c b/citadel/msgbase.c index a8d420d98..429f17a8b 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -2062,12 +2062,9 @@ START_TEXT: if ((!eoh) && (*mptr == '\n')) { - if (crlf) { - eoh = (*(mptr+1) == '\r') && (*(mptr+2) == '\n'); - } - else { + eoh = (*(mptr+1) == '\r') && (*(mptr+2) == '\n'); + if (!eoh) eoh = *(mptr+1) == '\n'; - } } if (