]> source.dussan.org Git - rspamd.git/commitdiff
Fix issue with regexps parsing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 14 Nov 2013 16:21:45 +0000 (16:21 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 14 Nov 2013 16:21:45 +0000 (16:21 +0000)
src/cfg_rcl.c
src/expressions.c

index 633dac99cdedadc81e04272bd15ba2f86f7edecb..956c60bb87bd6834bcc26ab4b0e0427737d20604 100644 (file)
@@ -451,7 +451,7 @@ rspamd_rcl_worker_handler (struct config_file *cfg, ucl_object_t *obj,
        if (val != NULL && ucl_object_tostring_safe (val, &worker_type)) {
                qtype = g_quark_try_string (worker_type);
                if (qtype != 0) {
-                       wrk = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct worker_conf));
+                       wrk = check_worker_conf (cfg, NULL);
                        wrk->worker = get_worker_by_type (qtype);
                        if (wrk->worker == NULL) {
                                g_set_error (err, CFG_RCL_ERROR, EINVAL, "unknown worker type: %s", worker_type);
index df98b5a509a5c20438187bebdc21139e06d1adc9..f63ec2d749f29ff397b94487643e0615a32bec47 100644 (file)
@@ -614,7 +614,15 @@ parse_regexp (memory_pool_t * pool, const gchar *line, gboolean raw_mode)
        /* First try to find header name */
        begin = strchr (line, '/');
        if (begin != NULL) {
-               end = strrchr (begin, '=');
+               p = begin;
+               end = NULL;
+               while (p != line) {
+                       if (*p == '=') {
+                               end = p;
+                               break;
+                       }
+                       p --;
+               }
                if (end) {
                        result->header = memory_pool_alloc (pool, end - line + 1);
                        rspamd_strlcpy (result->header, line, end - line + 1);