aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-27 18:33:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-27 18:33:45 +0000
commit8c0970499e5aa238df5e12cabba9f10388c56215 (patch)
treecb33a553d2d8abe593f1b4b5d725894426d4ea86 /src
parente2cb16d8f40cd7193b27e05c88aa23e0639d38be (diff)
downloadrspamd-8c0970499e5aa238df5e12cabba9f10388c56215.tar.gz
rspamd-8c0970499e5aa238df5e12cabba9f10388c56215.zip
[Fix] Some fixes for raw parts
Diffstat (limited to 'src')
-rw-r--r--src/libstat/tokenizers/tokenizers.c1
-rw-r--r--src/libutil/regexp.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/libstat/tokenizers/tokenizers.c b/src/libstat/tokenizers/tokenizers.c
index 59e58809f..51c711cf8 100644
--- a/src/libstat/tokenizers/tokenizers.c
+++ b/src/libstat/tokenizers/tokenizers.c
@@ -744,6 +744,7 @@ rspamd_normalize_single_word (rspamd_stat_token_t *tok, rspamd_mempool_t *pool)
rspamd_strlcpy (dest, tok->original.begin, tok->original.len + 1);
rspamd_str_lc (dest, tok->original.len);
tok->normalized.len = tok->original.len;
+ tok->normalized.begin = dest;
}
}
}
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index f0f16f423..a3246ae9f 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -570,7 +570,11 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
#endif
}
- g_assert (r != NULL);
+ if (r == NULL) {
+ /* Invalid regexp type for the specified input */
+ return FALSE;
+ }
+
ncaptures = (re->ncaptures + 1) * 3;
ovec = g_alloca (sizeof (gint) * ncaptures);