diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-23 14:10:07 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-23 14:10:07 +0300 |
commit | c79b5ccd22cbc1c273479f4f88189a18effda533 (patch) | |
tree | 1741743779a70146a61cd1767936aa43d671e36b /src/cfg_utils.c | |
parent | afdaddc4d0745a5bcefad73dd74fd4c03ae3de15 (diff) | |
download | rspamd-c79b5ccd22cbc1c273479f4f88189a18effda533.tar.gz rspamd-c79b5ccd22cbc1c273479f4f88189a18effda533.zip |
* Fix error in expression parser that causes bad errors with expressions that have regexp at the end
* Improve test for fuzzy hashes
* Add new object - TextPart to perl XS library that allows access to stripped parts and fuzzy hashes
* Add documentation for expressions parser and fot Mail::Rspamd::TextPart
* Allways calculate fuzzy hash for text parts
* Store text parts separately from other parts
* Add compare_parts_distance for expressions that calculates difference in 2 parts messages
* Do not try to substitute variables in empty strings
Diffstat (limited to 'src/cfg_utils.c')
-rw-r--r-- | src/cfg_utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cfg_utils.c b/src/cfg_utils.c index 1eeb518ed..037f23754 100644 --- a/src/cfg_utils.c +++ b/src/cfg_utils.c @@ -355,6 +355,11 @@ substitute_variable (struct config_file *cfg, char *str, u_char recursive) char *var, *new, *v_begin, *v_end; size_t len; + if (str == NULL) { + yywarn ("substitute_variable: trying to substitute variable in NULL string"); + return NULL; + } + while ((v_begin = strstr (str, "${")) != NULL) { len = strlen (str); *v_begin = '\0'; |