From 935f4bf5b92bb066f7c1aa9fbe41b685e7677180 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Thu, 6 Apr 2017 20:42:19 +0200 Subject: mshow: render_mime: don't access invalid addresses when no output was generated --- mshow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mshow.c') diff --git a/mshow.c b/mshow.c index da553bd..fa72ebc 100644 --- a/mshow.c +++ b/mshow.c @@ -203,9 +203,11 @@ render_mime(int depth, struct message *msg, char *body, size_t bodylen) if (e == 0) { // replace output printf(" render=\"%s\" ---\n", cmd); - print_ascii(output, outlen); - if (output[outlen-1] != '\n') - putchar('\n'); + if (outlen) { + print_ascii(output, outlen); + if (output[outlen-1] != '\n') + putchar('\n'); + } } else if (e == 63) { // skip filter free(output); goto nofilter; -- cgit 1.4.1