From 61cd8387850ee834a7779da942819f347bcff5e3 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Fri, 22 Jul 2016 18:43:34 +0200 Subject: [PATCH] mshow: don't crash on missing Content-Type (consider it text/plain) --- mshow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);