aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-14 16:21:45 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-14 16:21:45 +0000
commit917f52af5c8180096d541f8c9d6c1b11ce96aaae (patch)
tree7073276744111e79a890611252b4fc1afd2d20ff
parent7347509ead19b66f951194147d12c9d769a90c20 (diff)
downloadrspamd-917f52af5c8180096d541f8c9d6c1b11ce96aaae.tar.gz
rspamd-917f52af5c8180096d541f8c9d6c1b11ce96aaae.zip
Fix issue with regexps parsing.
-rw-r--r--src/cfg_rcl.c2
-rw-r--r--src/expressions.c10
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);