From: Vsevolod Stakhov Date: Sun, 10 Nov 2013 16:20:55 +0000 (+0000) Subject: Do not crash on an invalid xml config. X-Git-Tag: 0.6.0~77 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4dcae5b51390cedeb274a94316bf2dc48ab6a80c;p=rspamd.git Do not crash on an invalid xml config. --- diff --git a/src/cfg_utils.c b/src/cfg_utils.c index 35f0f44b7..dd6b00dcd 100644 --- a/src/cfg_utils.c +++ b/src/cfg_utils.c @@ -1025,10 +1025,14 @@ read_rspamd_config (struct config_file *cfg, const gchar *filename, const gchar res = TRUE; } + if (!res) { + return FALSE; + } + top = rspamd_rcl_config_init (); err = NULL; - if (!res || !rspamd_read_rcl_config (top, cfg, cfg->rcl_obj, &err)) { + if (!rspamd_read_rcl_config (top, cfg, cfg->rcl_obj, &err)) { msg_err ("rcl parse error: %s", err->message); return FALSE; }