diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-13 21:34:46 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-13 21:34:46 +0200 |
commit | f122c3c7d2f8586a878982db1e218973bcc3347c (patch) | |
tree | 15319e4f6050154e231fb7df28e73529dd79644c | |
parent | 411c9b632adfad234aacf9724c26d19ee38c1a8b (diff) | |
download | mblaze-f122c3c7d2f8586a878982db1e218973bcc3347c.tar.gz mblaze-f122c3c7d2f8586a878982db1e218973bcc3347c.tar.xz mblaze-f122c3c7d2f8586a878982db1e218973bcc3347c.zip |
rfc2045: blaze822_mime_body: zero output fields when no body is there
-rw-r--r-- | rfc2045.c | 5 |
1 files changed, 4 insertions, 1 deletions
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"); |