From 30831a33248f14718e200eb4548f9c5f73ca2b05 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Tue, 18 Dec 2012 02:21:57 -0800 Subject: [PATCH] fix problem where mutt_substrdup() was called with the start pointer > end pointer, as a result of using SKIPWS(). This occurred because the header field had an empty body, so the trailing newline was skipped over. The fix is to just skip over ascii space and htab. closes #3609 --- sendlib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sendlib.c b/sendlib.c index 249d6a1d..44382602 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1814,7 +1814,11 @@ static int write_one_header (FILE *fp, int pfxw, int max, int wraplen, { tagbuf = mutt_substrdup (start, t); ++t; /* skip over the colon separating the header field name and value */ - SKIPWS(t); /* skip over any leading whitespace */ + + /* skip over any leading whitespace (WSP, as defined in RFC5322) */ + while (*t == ' ' || *t == '\t') + t++; + valbuf = mutt_substrdup (t, end); } dprint(4,(debugfile,"mwoh: buf[%s%s] too long, " -- 2.49.0