summary refs log tree commit diff
path: root/rfc2047.c
diff options
context:
space:
mode:
Diffstat (limited to 'rfc2047.c')
-rw-r--r--rfc2047.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rfc2047.c b/rfc2047.c
index f25762d..b581976 100644
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -130,6 +130,10 @@ blaze822_decode_rfc2047(char *dst, char *src, size_t dlen, char *tgtenc)
 	iconv_t ic = (iconv_t)-1;
 	char *srcenc = 0;
 
+	// need space for trailing nul
+	if (dlen-- == 0)
+		return 0;
+
 	char *startdst = dst;
 	size_t startdlen = dlen;