From e7059c97ee940941455a1d0b8fe0adb292ce8d7c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 18 Nov 2019 12:14:54 +0000 Subject: [Fix] Fix utf8 validation for symbols options and empty strings --- src/libutil/str_util.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libutil/str_util.c') diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index 9f4ad1cb0..8fcaca484 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -3067,7 +3067,11 @@ rspamd_str_make_utf_valid (const guchar *src, gsize slen, } if (slen == 0) { - return NULL; + if (dstlen) { + *dstlen = 0; + } + + return pool ? rspamd_mempool_strdup (pool, "") : g_strdup (""); } p = src; -- cgit v1.2.3