aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamd.c
diff options
context:
space:
mode:
authorThierry Fournier <thierry.fournier@ozon.io>2020-03-07 14:48:31 +0100
committerThierry Fournier <thierry.fournier@ozon.io>2020-03-10 17:24:47 +0100
commita13343134a29943f90f849018aab9801b14edc82 (patch)
tree920dec2babdec4981513076a9ed83d4b1d8ced1d /src/rspamd.c
parent35179d94a8af87c5b86e45d0bd1ba9a276d34844 (diff)
downloadrspamd-a13343134a29943f90f849018aab9801b14edc82.tar.gz
rspamd-a13343134a29943f90f849018aab9801b14edc82.zip
[Minor] Segfault for some configuration.
When the configuration file contains only these two lines, rspamd try to send log which announce that it can bind the soket, but "bind_conf" is NULL and it is dereferenced, so we have a segfault. worker "normal" { } This patch fix the segfault.
Diffstat (limited to 'src/rspamd.c')
-rw-r--r--src/rspamd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rspamd.c b/src/rspamd.c
index 12f0cae2c..dee990c41 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -706,8 +706,13 @@ spawn_workers (struct rspamd_main *rspamd_main, struct ev_loop *ev_base)
spawn_worker_type (rspamd_main, ev_base, cf);
}
else {
- msg_err_main ("cannot create listen socket for %s at %s",
- g_quark_to_string (cf->type), cf->bind_conf->name);
+ if (cf->bind_conf == NULL) {
+ msg_err_main ("cannot create listen socket for %s",
+ g_quark_to_string (cf->type));
+ } else {
+ msg_err_main ("cannot create listen socket for %s at %s",
+ g_quark_to_string (cf->type), cf->bind_conf->name);
+ }
rspamd_hard_terminate (rspamd_main);
g_assert_not_reached ();