From e7c661ea1ac16aacd51c179878cda8eded74414c Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sun, 28 Jan 2018 05:41:12 -0700 Subject: * Different systems implement strncpy and memmove in different ways. Some add trailing nulls, some don't. We tie off the forward subject at the location where it should end. Reported by Ferdinand Goldman. --- pith/reply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pith/reply.c') diff --git a/pith/reply.c b/pith/reply.c index c7a481f4..2aa9ba22 100644 --- a/pith/reply.c +++ b/pith/reply.c @@ -2237,7 +2237,7 @@ forward_subject(ENVELOPE *env, int flags) snprintf(tmp_20k_buf+2000, SIZEOF_20KBUF-2000, "%s (fwd)", tmp_20k_buf); tmp_20k_buf[SIZEOF_20KBUF-2000-1] = '\0'; memmove(tmp_20k_buf, tmp_20k_buf+2000, strlen(tmp_20k_buf+2000)); - tmp_20k_buf[SIZEOF_20KBUF-1] = '\0'; + tmp_20k_buf[strlen(tmp_20k_buf+2000)] = '\0'; } /* -- cgit v1.2.3-54-g00ecf