From f122c3c7d2f8586a878982db1e218973bcc3347c Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Wed, 13 Jul 2016 21:34:46 +0200 Subject: rfc2045: blaze822_mime_body: zero output fields when no body is there --- rfc2045.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rfc2045.c') diff --git a/rfc2045.c b/rfc2045.c index eb23d0c..8f913a1 100644 --- a/rfc2045.c +++ b/rfc2045.c @@ -18,8 +18,11 @@ blaze822_check_mime(struct message *msg) int blaze822_mime_body(struct message *msg, char **cto, char **bodyo, size_t *bodyleno) { - if (!msg->body || !msg->bodyend) + if (!msg->body || !msg->bodyend) { + *bodyo = 0; + *bodyleno = 0; return -1; + } char *ct = blaze822_hdr(msg, "content-type"); char *cte = blaze822_hdr(msg, "content-transfer-encoding"); -- cgit 1.4.1