aboutsummaryrefslogtreecommitdiffstats
path: root/src/fstring.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-16 23:35:50 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-08-16 23:35:50 +0100
commit797ed49118014e8ad121a04b585526734ad6b335 (patch)
tree7a7592cdeeb04e4c4e45152164789e23163172c2 /src/fstring.c
parentfc9dbea5f5e423a12d5c8d7324ef48e7369b675c (diff)
downloadrspamd-797ed49118014e8ad121a04b585526734ad6b335.tar.gz
rspamd-797ed49118014e8ad121a04b585526734ad6b335.zip
Fix some warnings found by coverity scan.
Diffstat (limited to 'src/fstring.c')
-rw-r--r--src/fstring.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fstring.c b/src/fstring.c
index 9f17ac861..8028d15a3 100644
--- a/src/fstring.c
+++ b/src/fstring.c
@@ -398,7 +398,9 @@ fstrhash_lowercase (f_str_t * str, gboolean is_utf)
if (is_utf) {
while (end < str->begin + str->len) {
- g_utf8_validate (p, str->len, &end);
+ if (!g_utf8_validate (p, str->len, &end)) {
+ return fstrhash_lowercase (str, FALSE);
+ }
while (p < end) {
uc = g_unichar_tolower (g_utf8_get_char (p));
for (j = 0; j < sizeof (gunichar); j ++) {