From 917f52af5c8180096d541f8c9d6c1b11ce96aaae Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 14 Nov 2013 16:21:45 +0000 Subject: [PATCH] Fix issue with regexps parsing. --- src/cfg_rcl.c | 2 +- src/expressions.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cfg_rcl.c b/src/cfg_rcl.c index 633dac99c..956c60bb8 100644 --- a/src/cfg_rcl.c +++ b/src/cfg_rcl.c @@ -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); diff --git a/src/expressions.c b/src/expressions.c index df98b5a50..f63ec2d74 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -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); -- 2.39.5