about summary refs log tree commit diff
path: root/mshow.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-04-06 20:42:19 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-04-06 21:02:16 +0200
commit935f4bf5b92bb066f7c1aa9fbe41b685e7677180 (patch)
treefe8fe0024074857175983b5b615d2d229ae363fc /mshow.c
parent9e8e0d38c9826b10bd56289ffc92d84bc22ba5f8 (diff)
downloadmblaze-935f4bf5b92bb066f7c1aa9fbe41b685e7677180.tar.gz
mblaze-935f4bf5b92bb066f7c1aa9fbe41b685e7677180.tar.xz
mblaze-935f4bf5b92bb066f7c1aa9fbe41b685e7677180.zip
mshow: render_mime: don't access invalid addresses when no output was generated
Diffstat (limited to 'mshow.c')
-rw-r--r--mshow.c8
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;