mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 935f4bf5b92bb066f7c1aa9fbe41b685e7677180
parent 9e8e0d38c9826b10bd56289ffc92d84bc22ba5f8
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Thu,  6 Apr 2017 20:42:19 +0200

mshow: render_mime: don't access invalid addresses when no output was generated

Diffstat:
mshow.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 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;