* fix off by one while copying email headers
authorWilfried Göesgens <willi@citadel.org>
Thu, 4 Mar 2010 23:19:24 +0000 (23:19 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 4 Mar 2010 23:19:24 +0000 (23:19 +0000)
* check for CRLF regardles of what the caller is telling us, we did it like that in advance too.

citadel/internet_addressing.c
citadel/msgbase.c

index 14439a6abce4d3b8fa8a922c6b216406492a4a1a..ce8337f859bde64855d9ba0799f15937755f9dab 100644 (file)
@@ -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.
index a8d420d98a94a0675c5fd98bd2d171ebdd94764e..429f17a8b4e6b56baef7f91a26f6f20fb17c8d94 100644 (file)
@@ -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 (