mblaze

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

commit d4cbac0aa5a58e0ea9e8522300bdc24b4d98980f
parent 54435b30b6c9f42d13842927e20c27aa267ef960
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Thu, 21 Sep 2017 14:53:13 +0200

mmime: gen_qp: quote ^From and ^.$ to be safe

Diffstat:
mmime.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mmime.c b/mmime.c @@ -85,7 +85,11 @@ int gen_qp(uint8_t *s, off_t size, int maxlinelen, int linelen) } if ((s[i] > 126) || - (s[i] == '=')) { + (s[i] == '=') || + (linelen == 0 && + (strncmp((char *)s, "From ", 5) == 0 || + (s[i] == '.' && i+1 < size && + (s[i+1] == '\n' || s[i+1] == '\r'))))) { printf("=%02X", s[i]); linelen += 3; prev = s[i];