From 7e669f1b5d51b1d562efd79ef04b8441574c0334 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 5 Mar 2006 14:38:23 +0000 Subject: [PATCH] don't try to malloc 0 bytes if an RFC2047 encoded block is empty --- ChangeLog | 5 +++++ sbr/fmt_rfc2047.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8439478..c6ea906 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-05 Oliver Kiddle + + * sbr/fmt_rfc2047.c: don't try to malloc 0 bytes if an RFC2047 + encoded block is empty + 2006-03-04 Peter Maydell * etc/Makefile.in: use INSTALL_SCRIPT to install scripts; diff --git a/sbr/fmt_rfc2047.c b/sbr/fmt_rfc2047.c index 0eb71bd..83ef21e 100644 --- a/sbr/fmt_rfc2047.c +++ b/sbr/fmt_rfc2047.c @@ -196,6 +196,13 @@ decode_rfc2047 (char *str, char *dst, size_t dstlen) } #ifdef HAVE_ICONV + /* + * empty encoded text. This ensures that we don't + * malloc 0 bytes but skip on to the end + */ + if (endofmime == startofmime) + use_iconv = 0; + if (use_iconv) { saveq = q; savedstlen = dstlen; -- 1.7.10.4