From: Vsevolod Stakhov Date: Fri, 17 Sep 2021 11:46:41 +0000 (+0100) Subject: [Minor] Escape \uFFFD in the sources X-Git-Tag: 3.1~156 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6f5881e0bb7468a4ff1a52bdbd40cc36102639fd;p=rspamd.git [Minor] Escape \uFFFD in the sources --- diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx index 912da6e58..8a3ff61da 100644 --- a/src/libserver/html/html_entities.cxx +++ b/src/libserver/html/html_entities.cxx @@ -2605,10 +2605,10 @@ TEST_SUITE("html entities") { {"FOO&#ZOO", "FOO&#ZOO"}, {"FOOºR", "FOOºR"}, {"FOO䆺R", "FOO䆺R"}, - {"FOO�ZOO", "FOO�ZOO"}, + {"FOO�ZOO", "FOO\uFFFDZOO"}, {"FOOZOO", "FOO\u0081ZOO"}, - {"FOO�ZOO", "FOO�ZOO"}, - {"FOO�ZOO", "FOO�ZOO"}, + {"FOO�ZOO", "FOO\uFFFDZOO"}, + {"FOO�ZOO", "FOO\uFFFDZOO"}, {"ZZ£_id=23", "ZZ£_id=23"}, {"ZZ&prod_id=23", "ZZ&prod_id=23"}, {"ZZ>", "ZZ>"}, diff --git a/src/libutil/cxx/utf8_util.cxx b/src/libutil/cxx/utf8_util.cxx index cf6e70fe6..da68c990c 100644 --- a/src/libutil/cxx/utf8_util.cxx +++ b/src/libutil/cxx/utf8_util.cxx @@ -225,7 +225,7 @@ TEST_CASE("utf8 normalise") { {"13\u200C_\u0020\u0308\u0301\u038e\u03ab\u200D", "13_ ̈́ΎΫ", RSPAMD_UNICODE_NORM_UNNORMAL|RSPAMD_UNICODE_NORM_ZERO_SPACES}, /* Buffer overflow case */ - {"u\xC2\xC2\xC2\xC2\xC2\xC2""abcdef""abcdef", "u������", + {"u\xC2\xC2\xC2\xC2\xC2\xC2""abcdef""abcdef", "u\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD", RSPAMD_UNICODE_NORM_UNNORMAL|RSPAMD_UNICODE_NORM_ERROR}, };