mblaze

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

commit 4e13b732453105104901c253b7989c16e812c112
parent 6948b408a292db316e86d777e574891ff5cedbfa
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Mon, 21 Aug 2017 19:13:14 +0200

mshow: render_mime: avoid indexing into empty buffer

Found using spam corpus at http://untroubled.org/spam/2017-08.7z

Diffstat:
mshow.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mshow.c b/mshow.c @@ -270,7 +270,7 @@ nofilter: strcasecmp(charset, "utf8") == 0 || strcasecmp(charset, "us-ascii") == 0) { print_ascii(body, bodylen); - if (body[bodylen-1] != '\n') + if (bodylen > 0 && body[bodylen-1] != '\n') putchar('\n'); } else { print_u8recode(body, bodylen, charset);