diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-03-14 14:54:14 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-03-14 14:55:04 +0000 |
commit | a73a67f91d561f7458fa7ebe61f3ff4eeab0fb1e (patch) | |
tree | 13a1ada37e0f5c8977baffe622da76d9f3b8f5a3 | |
parent | de384ad1e4f0c0b4a79847e8b182fdf9c0b930f6 (diff) | |
download | rspamd-a73a67f91d561f7458fa7ebe61f3ff4eeab0fb1e.tar.gz rspamd-a73a67f91d561f7458fa7ebe61f3ff4eeab0fb1e.zip |
[Fix] Fuzzy add/delete handlers are badly broken for compression
-rw-r--r-- | src/plugins/fuzzy_check.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 62ddef504..15f556c40 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -3467,8 +3467,13 @@ fuzzy_process_handler(struct rspamd_http_connection_entry *conn_ent, if (!is_hash) { /* Allocate message from string */ /* XXX: what about encrypted messages ? */ - task->msg.begin = msg->body_buf.begin; - task->msg.len = msg->body_buf.len; + if (!rspamd_task_load_message(task, msg, msg->body_buf.begin, msg->body_buf.len)) { + msg_warn_task("cannot load message for fuzzy"); + rspamd_controller_send_error(conn_ent, 400, "Message load error"); + rspamd_task_free(task); + + return; + } r = rspamd_message_parse(task); |