don't try to malloc 0 bytes if an RFC2047 encoded block is empty
[mmh] / sbr / fmt_rfc2047.c
index 0eb71bd..83ef21e 100644 (file)
@@ -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;