aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-23 16:03:48 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-23 16:03:48 +0000
commit3b19414d0310cbbac21b88188cc48eb6627df3c0 (patch)
treeab576c20dcbb837e55a36de0b1f9d1c918bfe81f /src
parente03d9dac6c7829a67b95815a30a22ffa756aed47 (diff)
downloadrspamd-3b19414d0310cbbac21b88188cc48eb6627df3c0.tar.gz
rspamd-3b19414d0310cbbac21b88188cc48eb6627df3c0.zip
Fix crash in re_cache as headers are not NULL terminated
Diffstat (limited to 'src')
-rw-r--r--src/libmime/mime_expressions.c2
-rw-r--r--src/lua/lua_config.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index cf9f29fac..57275e004 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -636,7 +636,7 @@ set:
mime_atom->d.re->type == RSPAMD_RE_RAWHEADER) {
rspamd_re_cache_add (cfg->re_cache, mime_atom->d.re->regexp,
mime_atom->d.re->type, mime_atom->d.re->header,
- strlen (mime_atom->d.re->header));
+ strlen (mime_atom->d.re->header) + 1);
}
else {
rspamd_re_cache_add (cfg->re_cache, mime_atom->d.re->regexp,
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 0e61ead07..8a8ac9e6f 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1609,7 +1609,7 @@ lua_config_register_regexp (lua_State *L)
}
rspamd_re_cache_add (cfg->re_cache, re->re, type,
- (gpointer) header_str, header_len);
+ (gpointer) header_str, header_len + 1);
}
}
}