diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-06 16:05:16 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-06 16:05:16 +0000 |
commit | 4b0615f1d6983ef1c9e3c292c4608d3f37df2172 (patch) | |
tree | c325327c430b156b12454f32d363e4927eccf813 /src | |
parent | eec94c8f0a11902803983efe093e4b4de9359898 (diff) | |
download | rspamd-4b0615f1d6983ef1c9e3c292c4608d3f37df2172.tar.gz rspamd-4b0615f1d6983ef1c9e3c292c4608d3f37df2172.zip |
Fix several memory corruption issues
Diffstat (limited to 'src')
-rw-r--r-- | src/libstat/backends/mmaped_file.c | 5 | ||||
-rw-r--r-- | src/libstat/stat_config.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/libstat/backends/mmaped_file.c b/src/libstat/backends/mmaped_file.c index 5e0b176ef..d54d449b2 100644 --- a/src/libstat/backends/mmaped_file.c +++ b/src/libstat/backends/mmaped_file.c @@ -816,7 +816,10 @@ rspamd_mmaped_file_init (struct rspamd_stat_ctx *ctx, size = ucl_object_toint (sizeo); mf = rspamd_mmaped_file_open (cfg->cfg_pool, filename, size, stf); - mf->pool = cfg->cfg_pool; + + if (mf != NULL) { + mf->pool = cfg->cfg_pool; + } return (gpointer)mf; } diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c index e307c276c..1646ce3b7 100644 --- a/src/libstat/stat_config.c +++ b/src/libstat/stat_config.c @@ -143,6 +143,7 @@ rspamd_stat_init (struct rspamd_config *cfg, struct event_base *ev_base) /* Init classifier cache */ if (clf->opts) { cache_obj = ucl_object_find_key (clf->opts, "cache"); + cache_name_obj = NULL; if (cache_obj) { cache_name_obj = ucl_object_find_key (cache_obj, "name"); |