]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Sigh, another fix vstakhov-fix-2047-encode 5223/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 18 Nov 2024 18:43:03 +0000 (18:43 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Mon, 18 Nov 2024 18:43:03 +0000 (18:43 +0000)
src/libmime/mime_headers.c
test/rspamd_cxx_unit_rfc2047.hxx

index f33311bbfc43cf7341c27ebcbf23a52350adffd1..63419d6a399791c51310f6c6b3bd530e0054a30b 100644 (file)
@@ -863,7 +863,7 @@ rspamd_mime_header_encode(const char *in, gsize len, bool is_structured)
 
                                        if (need_encoding && (c == '(' || c == ')')) {
                                                /* If we need to encode, we must stop on comments characters */
-                                               piece_len = i + 1;
+                                               piece_len = i;
                                                q = p + piece_len;
                                                /* No more space */
                                                break;
index 0f6f2eabb44b969f824fe4b6710a19f36230058f..ebb11cdc121089068e39e5c236c2adf06768e4f5 100644 (file)
@@ -35,7 +35,7 @@ TEST_SUITE("rfc2047 encode")
                         "PDF_LONG_TRAILER (0.20)[=?UTF-8?Q?=D0=94=D0=BE=D0=BA=2E=D0=B7=D0=B0?= 10102024.pdf:416662]"},
                        {"Hello World", "Hello World"},
                        {"Hello Мир", "Hello =?UTF-8?Q?=D0=9C=D0=B8=D1=80?="},
-                       {"ололо (ололо test)    test", "=?UTF-8?Q?=D0=BE=D0=BB=D0=BE=D0=BB=D0=BE_?=(=?UTF-8?Q?=D0=BE=D0=BB=D0=BE=D0=BB=D0=BE_?=test)    test"},
+                       {"ололо (ололо test)    test", "=?UTF-8?Q?=D0=BE=D0=BB=D0=BE=D0=BB=D0=BE?= (=?UTF-8?Q?=D0=BE=D0=BB=D0=BE=D0=BB=D0=BE?= test)    test"},
                        {"Привет    мир Как дела?", "=?UTF-8?Q?=D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82____=D0=BC=D0=B8=D1=80_=D0?="
                                                                                "=?UTF-8?Q?=9A=D0=B0=D0=BA_=D0=B4=D0=B5=D0=BB=D0=B0?=?"},
                        {"", ""},