From 9bd616ca7aca3ff3fcd3a051e110f2d6e9abc76b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 18 Nov 2024 18:43:03 +0000 Subject: [Fix] Sigh, another fix --- src/libmime/mime_headers.c | 2 +- test/rspamd_cxx_unit_rfc2047.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index f33311bbf..63419d6a3 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -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; diff --git a/test/rspamd_cxx_unit_rfc2047.hxx b/test/rspamd_cxx_unit_rfc2047.hxx index 0f6f2eabb..ebb11cdc1 100644 --- a/test/rspamd_cxx_unit_rfc2047.hxx +++ b/test/rspamd_cxx_unit_rfc2047.hxx @@ -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?=?"}, {"", ""}, -- cgit v1.2.3