aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-15 18:53:14 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-15 18:53:14 +0000
commit80cf2041596f5315f3c9e2cf018dd55018decf35 (patch)
tree0afeea3847ea7fcab5b4e4fa8c87e5b905515d10 /contrib
parentfffd9e6f1084f425a9fcda67cad90c2f8a04f264 (diff)
downloadrspamd-80cf2041596f5315f3c9e2cf018dd55018decf35.tar.gz
rspamd-80cf2041596f5315f3c9e2cf018dd55018decf35.zip
[Minor] Use ref impl for small strings
Diffstat (limited to 'contrib')
-rw-r--r--contrib/fastutf8/fastutf8.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/fastutf8/fastutf8.c b/contrib/fastutf8/fastutf8.c
index 4a8d3309b..2a5a9983c 100644
--- a/contrib/fastutf8/fastutf8.c
+++ b/contrib/fastutf8/fastutf8.c
@@ -154,5 +154,7 @@ rspamd_fast_utf8_library_init (unsigned flags)
off_t
rspamd_fast_utf8_validate (const unsigned char *data, size_t len)
{
- return validate_func (data, len);
+ return len >= 64 ?
+ validate_func (data, len) :
+ rspamd_fast_utf8_validate_ref (data, len);
} \ No newline at end of file