diff options
author | Leah Neukirchen <leah@vuxu.org> | 2017-04-06 20:42:19 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2017-04-06 21:02:16 +0200 |
commit | 935f4bf5b92bb066f7c1aa9fbe41b685e7677180 (patch) | |
tree | fe8fe0024074857175983b5b615d2d229ae363fc | |
parent | 9e8e0d38c9826b10bd56289ffc92d84bc22ba5f8 (diff) | |
download | mblaze-935f4bf5b92bb066f7c1aa9fbe41b685e7677180.tar.gz mblaze-935f4bf5b92bb066f7c1aa9fbe41b685e7677180.tar.xz mblaze-935f4bf5b92bb066f7c1aa9fbe41b685e7677180.zip |
mshow: render_mime: don't access invalid addresses when no output was generated
-rw-r--r-- | mshow.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; |