commit e498305: [Minor] Fix for old libicu

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jun 21 12:42:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-06-21 13:39:26 +0100
URL: https://github.com/rspamd/rspamd/commit/e498305676c6975a12afdb4216697248f5eb3456 (HEAD -> master)

[Minor] Fix for old libicu

---
 src/libserver/html/html_url.cxx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libserver/html/html_url.cxx b/src/libserver/html/html_url.cxx
index a95daccf6..f1a0538be 100644
--- a/src/libserver/html/html_url.cxx
+++ b/src/libserver/html/html_url.cxx
@@ -99,7 +99,8 @@ convert_idna_hostname_maybe(rspamd_mempool_t *pool, struct rspamd_url *url, bool
 		icu::IDNAInfo info;
 		auto uc_err = U_ZERO_ERROR;
 		auto *udn = get_icu_idna_instance();
-		udn->nameToASCII_UTF8(ret,byte_sink, info, uc_err);
+		udn->nameToASCII_UTF8(icu::StringPiece(ret.data(), ret.size()),
+				byte_sink, info, uc_err);
 
 		if (uc_err == U_ZERO_ERROR && !info.hasErrors()) {
 			ret = std::string_view{idn_hbuf, (std::size_t)byte_sink.NumberOfBytesWritten()};


More information about the Commits mailing list