summaryrefslogtreecommitdiffstats
path: root/rfc2045
diff options
context:
space:
mode:
authorSam Varshavchik2015-07-19 06:36:20 -0400
committerSam Varshavchik2015-07-19 06:36:20 -0400
commit796dc9a0b94b67f1303e1db61311f7b458e5e36a (patch)
tree517c8fc556745197d70a818e71512e45e90095dd /rfc2045
parent19309085193effe5d231fa3c99e8f9c33fdc2b4f (diff)
downloadcourier-libs-796dc9a0b94b67f1303e1db61311f7b458e5e36a.tar.bz2
Fix parsing of a message without a body.
Until the empty line separating headers from body is read, point startofbody at the end of the parsed text, so if the empty line is never read, the entire contents of the message is parsed as headers.
Diffstat (limited to 'rfc2045')
-rw-r--r--rfc2045/rfc2045.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/rfc2045/rfc2045.c b/rfc2045/rfc2045.c
index 8cbd3a7..40c2017 100644
--- a/rfc2045/rfc2045.c
+++ b/rfc2045/rfc2045.c
@@ -652,6 +652,12 @@ int bit8=0;
update_counts(p, p->endpos + cnt, p->endpos+n, 1);
+ /*
+ ** Until we see an official start of message body, the body starts
+ ** right after what we just read.
+ */
+ p->startbody=p->endbody;
+
/* If this header line starts with a space, append one space
** to the saved contents of the previous line, and append this
** line to it.