]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Feature] Core: Relax quoted-printable encoding
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Jan 2019 14:11:50 +0000 (14:11 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Jan 2019 14:11:50 +0000 (14:11 +0000)
src/libutil/str_util.c

index 0c63edba2d1d8be3277587b92b5cf03ca3c26037..27d50aead98205de35657b6b5432f9d04a0e070b 100644 (file)
@@ -1931,7 +1931,7 @@ rspamd_decode_qp_buf (const gchar *in, gsize inlen,
        gchar *o, *end, *pos, c;
        const gchar *p;
        guchar ret;
-       gsize remain, processed;
+       gssize remain, processed;
 
        p = in;
        o = out;
@@ -1967,6 +1967,14 @@ decode:
 
                                continue;
                        }
+                       else {
+                               /* Hack, hack, hack, treat =<garbadge> as =<garbadge> */
+                               if (remain > 0) {
+                                       *o++ = *(p - 1);
+                               }
+
+                               continue;
+                       }
 
                        if (remain > 0) {
                                c = *p++;