From 4dcae5b51390cedeb274a94316bf2dc48ab6a80c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 10 Nov 2013 16:20:55 +0000 Subject: [PATCH] Do not crash on an invalid xml config. --- src/cfg_utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.39.5