diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-12-04 15:18:08 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-12-04 15:18:08 +0000 |
commit | 7a719d343eea81b0b8cbb8b24e7908b80d1f9a59 (patch) | |
tree | ad53dad926bf53f48598766dc79b896b163a3e6b /src/libmime/mime_headers.c | |
parent | 25e7d7ff17056d427e46a92d50a97355981c0e7f (diff) | |
download | rspamd-7a719d343eea81b0b8cbb8b24e7908b80d1f9a59.tar.gz rspamd-7a719d343eea81b0b8cbb8b24e7908b80d1f9a59.zip |
[Fix] Fix wrong raw_len usage
Diffstat (limited to 'src/libmime/mime_headers.c')
-rw-r--r-- | src/libmime/mime_headers.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index e250e84f1..1cbc57881 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -1289,6 +1289,7 @@ void rspamd_message_set_modified_header(struct rspamd_task *task, nhdr->separator = rspamd_mempool_strdup(task->task_pool, " "); rawbuf += sizeof(": ") - 1; memcpy(rawbuf, raw_value, raw_len); + nhdr->raw_len = raw_len; if (MESSAGE_FIELD(task, nlines_type) == RSPAMD_TASK_NEWLINES_LF) { rawbuf[raw_len++] = '\n'; @@ -1302,9 +1303,10 @@ void rspamd_message_set_modified_header(struct rspamd_task *task, } rawbuf[raw_len] = '\0'; - nhdr->raw_len = raw_len; + nhdr->decoded = rspamd_mime_header_decode(task->task_pool, - raw_value, raw_len, NULL); + raw_value, nhdr->raw_len, + NULL); /* Now find a position to insert a value */ struct rspamd_mime_header **pos = &hdr_elt->modified_chain; |