From 0a200b8a84a25a77b9027fd7274beedad6314eae Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 30 Jan 2011 13:14:05 +0100 Subject: [PATCH] QP-Decoding: Ignore case of letter indicating _B_inary or _Q_uoted printeable, there seem to be solutions around sending q,b instead of Q,B --- libcitadel/lib/stringbuf.c | 5 +++-- libcitadel/tests/testdata/qpstrings/list | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 libcitadel/tests/testdata/qpstrings/list diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index 88ce0679c..f621255c8 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -2830,7 +2830,8 @@ static inline const char *FindNextEnd (const StrBuf *Buf, const char *bptr) return NULL; if ((Buf->BufUsed - (end - Buf->buf) > 3) && - ((*(end + 1) == 'B') || (*(end + 1) == 'Q')) && + (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) || + ((*(end + 1) == 'b') || (*(end + 1) == 'q'))) && (*(end + 2) == '?')) { /* skip on to the end of the cluster, the next ?= */ end = strstr(end + 3, "?="); @@ -3083,7 +3084,7 @@ void StrBuf_RFC822_2_Utf8(StrBuf *Target, start = strstr(DecodeMee->buf, "=?"); eptr = DecodeMee->buf + DecodeMee->BufUsed; if (start != NULL) - end = FindNextEnd (DecodeMee, start); + end = FindNextEnd (DecodeMee, start + 2); else { StrBufAppendBuf(Target, DecodeMee, 0); FreeStrBuf(&DecodedInvalidBuf); diff --git a/libcitadel/tests/testdata/qpstrings/list b/libcitadel/tests/testdata/qpstrings/list new file mode 100644 index 000000000..a418935a1 --- /dev/null +++ b/libcitadel/tests/testdata/qpstrings/list @@ -0,0 +1,2 @@ +=?utf-8?q?=5Bubuntuusers=5D_Neue_Antwort_im_Thema_=E2=80=9EBaust?==?utf-8?b?ZWxsZS9DaXRhZGVs4oCc?= + -- 2.30.2