about summary refs log tree commit diff
path: root/rfc2045.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-13 21:34:46 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-13 21:34:46 +0200
commitf122c3c7d2f8586a878982db1e218973bcc3347c (patch)
tree15319e4f6050154e231fb7df28e73529dd79644c /rfc2045.c
parent411c9b632adfad234aacf9724c26d19ee38c1a8b (diff)
downloadmblaze-f122c3c7d2f8586a878982db1e218973bcc3347c.tar.gz
mblaze-f122c3c7d2f8586a878982db1e218973bcc3347c.tar.xz
mblaze-f122c3c7d2f8586a878982db1e218973bcc3347c.zip
rfc2045: blaze822_mime_body: zero output fields when no body is there
Diffstat (limited to 'rfc2045.c')
-rw-r--r--rfc2045.c5
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");