From: Vsevolod Stakhov Date: Fri, 27 Mar 2009 13:13:16 +0000 (+0300) Subject: * Fix parsing regexp with '=' symbol inside X-Git-Tag: 0.2.7~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ca00ea032e4e53641640daa1682af21d1038a43;p=thirdparty%2Frspamd.git * Fix parsing regexp with '=' symbol inside * Fix config file syntax checking --- diff --git a/src/expressions.c b/src/expressions.c index 683e13dd85..c1cd8c0bdf 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -458,8 +458,20 @@ parse_regexp (memory_pool_t *pool, char *line) return NULL; } /* First try to find header name */ - begin = strchr (line, '='); + begin = strchr (line, '/'); if (begin != NULL) { + *begin = '\0'; + end = strchr (line, '='); + *begin = '/'; + if (end) { + *end = '\0'; + result->header = memory_pool_strdup (pool, line); + result->type = REGEXP_HEADER; + *end = '='; + line = end; + } + } + else { *begin = '\0'; result->header = memory_pool_strdup (pool, line); result->type = REGEXP_HEADER; @@ -467,7 +479,7 @@ parse_regexp (memory_pool_t *pool, char *line) line = begin; } /* Find begin of regexp */ - while (*line != '/') { + while (*line && *line != '/') { line ++; } if (*line != '\0') { diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 0fe64ba2fa..aacc7120b0 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -222,7 +222,7 @@ surbl_module_config (struct config_file *cfg) surbl_module_ctx->suffixes = g_list_prepend (surbl_module_ctx->suffixes, new_suffix); } - return 0; + return TRUE; } int