diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-18 12:14:54 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-18 12:14:54 +0000 |
commit | e7059c97ee940941455a1d0b8fe0adb292ce8d7c (patch) | |
tree | be85ba6ecefdf35677568d2b48d93e5eccd466b8 /src/libutil/str_util.c | |
parent | 677173f90b0df5d54d29734d0f46799a85787544 (diff) | |
download | rspamd-e7059c97ee940941455a1d0b8fe0adb292ce8d7c.tar.gz rspamd-e7059c97ee940941455a1d0b8fe0adb292ce8d7c.zip |
[Fix] Fix utf8 validation for symbols options and empty strings
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r-- | src/libutil/str_util.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |