]> source.dussan.org Git - rspamd.git/commitdiff
Do not crash on an invalid xml config.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 10 Nov 2013 16:20:55 +0000 (16:20 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 10 Nov 2013 16:20:55 +0000 (16:20 +0000)
src/cfg_utils.c

index 35f0f44b78f802729a2477fa27630b506f3d9c1f..dd6b00dcd92e3c148292b6ff98b15fea05b866b2 100644 (file)
@@ -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;
        }