about summary refs log tree commit diff
path: root/mshow.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-22 18:43:34 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-22 18:43:34 +0200
commit61cd8387850ee834a7779da942819f347bcff5e3 (patch)
treeb4359a2ad48feaa018a752e2c9da9a8fbdfd4031 /mshow.c
parentc8d5dd296a7331609566cd4a55962f834bc70aaa (diff)
downloadmblaze-61cd8387850ee834a7779da942819f347bcff5e3.tar.gz
mblaze-61cd8387850ee834a7779da942819f347bcff5e3.tar.xz
mblaze-61cd8387850ee834a7779da942819f347bcff5e3.zip
mshow: don't crash on missing Content-Type (consider it text/plain)
Diffstat (limited to 'mshow.c')
-rw-r--r--mshow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mshow.c b/mshow.c
index f5d9cac..3684faf 100644
--- a/mshow.c
+++ b/mshow.c
@@ -234,7 +234,7 @@ reply_mime(int depth, struct message *msg, char *body, size_t bodylen)
 	char *mt = mimetype(ct);
 	char *tlmt = tlmimetype(ct);
 
-	if (strncmp(ct, "text/plain", 10) == 0) {
+	if (!ct || strncmp(ct, "text/plain", 10) == 0) {
 		char *charset = 0, *cs, *cse;
 		if (blaze822_mime_parameter(ct, "charset", &cs, &cse))
 			charset = strndup(cs, cse-cs);