diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-08 09:45:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-08 09:45:57 +0100 |
commit | 25393770a6b48d63268233dea83e8120e8365d4b (patch) | |
tree | 6e65532998ed5a3a8406ed95976a3521ecc6ef0e | |
parent | 5bd10ab74cff6da707b201ce5b82f9726336cb4f (diff) | |
download | rspamd-25393770a6b48d63268233dea83e8120e8365d4b.tar.gz rspamd-25393770a6b48d63268233dea83e8120e8365d4b.zip |
[Fix] Fix some more issues with HTTP maps
-rw-r--r-- | src/libutil/map.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index fad48aeab..edd4eaa1f 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -512,6 +512,11 @@ http_map_finish (struct rspamd_http_connection *conn, } read_data: + if (cbd->data_len == 0) { + msg_err_map ("cannot read empty map"); + goto err; + } + g_assert (cbd->shmem_data != NULL); in = rspamd_shmem_xmap (cbd->shmem_data->shm_name, PROT_READ, &dlen); @@ -537,6 +542,7 @@ read_data: cache_cbd = g_slice_alloc0 (sizeof (*cache_cbd)); cache_cbd->shm = cbd->shmem_data; cache_cbd->map = map; + cache_cbd->data = cbd->data; cache_cbd->last_checked = cbd->data->last_checked; cache_cbd->gen = cbd->data->gen; MAP_RETAIN (cache_cbd->shm, "shmem_data"); |