aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-01-23 15:05:31 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-01-23 15:05:31 +0000
commit063784dd311b10484834292e7ab401941ccf502a (patch)
treedc92cd997b97fcca5ae9d8c8dc1836cae4581335
parentdcc00b052177f93894b7fb9e792bcd88498fd87d (diff)
downloadrspamd-063784dd311b10484834292e7ab401941ccf502a.tar.gz
rspamd-063784dd311b10484834292e7ab401941ccf502a.zip
[Minor] Maps: Check the object before usage
-rw-r--r--src/libutil/map_helpers.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libutil/map_helpers.c b/src/libutil/map_helpers.c
index 4b2b41fcb..ece3017ab 100644
--- a/src/libutil/map_helpers.c
+++ b/src/libutil/map_helpers.c
@@ -1142,7 +1142,7 @@ rspamd_match_regexp_map_single (struct rspamd_regexp_map_helper *map,
g_assert (in != NULL);
- if (map == NULL || len == 0) {
+ if (map == NULL || len == 0 || map->regexps == NULL) {
return NULL;
}
@@ -1233,7 +1233,7 @@ rspamd_match_regexp_map_all (struct rspamd_regexp_map_helper *map,
g_assert (in != NULL);
- if (map == NULL || len == 0) {
+ if (map == NULL || map->regexps == NULL || len == 0) {
return NULL;
}
@@ -1294,7 +1294,7 @@ rspamd_match_hash_map (struct rspamd_hash_map_helper *map, const gchar *in)
khiter_t k;
struct rspamd_map_helper_value *val;
- if (map == NULL) {
+ if (map == NULL || map->htb == NULL) {
return NULL;
}
@@ -1316,7 +1316,7 @@ rspamd_match_radix_map (struct rspamd_radix_map_helper *map,
{
struct rspamd_map_helper_value *val;
- if (map == NULL) {
+ if (map == NULL || map->trie == NULL) {
return NULL;
}
@@ -1338,7 +1338,7 @@ rspamd_match_radix_map_addr (struct rspamd_radix_map_helper *map,
{
struct rspamd_map_helper_value *val;
- if (map == NULL) {
+ if (map == NULL || map->trie == NULL) {
return NULL;
}