commit 58b5048: [Minor] Oops, fix more stuff

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jan 27 19:28:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-01-27 19:25:50 +0000
URL: https://github.com/rspamd/rspamd/commit/58b5048924664bd913b0b275e61dea9a088b17e7 (HEAD -> master)

[Minor] Oops, fix more stuff

---
 src/libmime/mime_encoding.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/libmime/mime_encoding.c b/src/libmime/mime_encoding.c
index 646b31eae..a91447ab6 100644
--- a/src/libmime/mime_encoding.c
+++ b/src/libmime/mime_encoding.c
@@ -724,10 +724,15 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
 			}
 		}
 		else {
-			/*
-			 * We have detected some charset, but we don't know which one
-			 */
-			valid_utf8 = FALSE;
+			text_part->real_charset = charset;
+
+			if (strcmp (charset, UTF8_CHARSET) != 0) {
+				/*
+				 * We have detected some charset, but we don't know which one,
+				 * so we need to reset valid utf8 flag and enforce it later
+				 */
+				valid_utf8 = FALSE;
+			}
 		}
 	}
 


More information about the Commits mailing list