commit bd3b1b6: [Minor] Fix use after free
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Dec 16 14:21:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-12-16 14:16:26 +0000
URL: https://github.com/rspamd/rspamd/commit/bd3b1b6d81ea91e3e4781c226e24d7162fa70e34 (HEAD -> master)
[Minor] Fix use after free
---
src/lua/lua_http.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c
index f7dd01e87..6ad5e6d21 100644
--- a/src/lua/lua_http.c
+++ b/src/lua/lua_http.c
@@ -467,6 +467,11 @@ static void
lua_http_dns_handler (struct rdns_reply *reply, gpointer ud)
{
struct lua_http_cbdata *cbd = (struct lua_http_cbdata *)ud;
+ struct rspamd_symcache_item *item;
+ struct rspamd_task *task;
+
+ task = cbd->task;
+ item = cbd->item;
if (reply->code != RDNS_RC_NOERROR) {
lua_http_push_error (cbd, "unable to resolve host");
@@ -497,8 +502,8 @@ lua_http_dns_handler (struct rdns_reply *reply, gpointer ud)
REF_RELEASE (cbd);
}
- if (cbd->item) {
- rspamd_symcache_item_async_dec_check (cbd->task, cbd->item, M);
+ if (item) {
+ rspamd_symcache_item_async_dec_check (task, item, M);
}
}
More information about the Commits
mailing list