]> granicus.if.org Git - neomutt/commitdiff
Do not assume whitespace follows the colon in a header field.
authorMichael Elkins <me@mutt.org>
Sun, 21 Mar 2010 16:52:44 +0000 (09:52 -0700)
committerMichael Elkins <me@mutt.org>
Sun, 21 Mar 2010 16:52:44 +0000 (09:52 -0700)
Closes #3385.

sendlib.c

index 45e62c027fb5fcd3c09934252dbd45e8040d3ffe..09460240b1c05a9dcbcebf946a6632f383189e2f 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1799,7 +1799,9 @@ static int write_one_header (FILE *fp, int pfxw, int max, int wraplen,
     else
     {
       tagbuf = mutt_substrdup (start, t);
-      valbuf = mutt_substrdup (t + 2, end);
+      ++t; /* skip over the colon separating the header field name and value */
+      SKIPWS(t); /* skip over any leading whitespace */
+      valbuf = mutt_substrdup (t, end);
     }
     dprint(4,(debugfile,"mwoh: buf[%s%s] too long, "
              "max width = %d > %d\n",