aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/mime_headers.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-07-27 16:24:39 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-07-27 16:24:39 +0100
commitf042f98099e3f53dcabf30f03507a71de6f07bdf (patch)
treee341f33375942e5b8e1dbd99b33e871e24db6665 /src/libmime/mime_headers.c
parentc413d85f2902f221278e342b37032119df7ebf11 (diff)
downloadrspamd-f042f98099e3f53dcabf30f03507a71de6f07bdf.tar.gz
rspamd-f042f98099e3f53dcabf30f03507a71de6f07bdf.zip
[Minor] Save zero terminated string properly
Diffstat (limited to 'src/libmime/mime_headers.c')
-rw-r--r--src/libmime/mime_headers.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index de4184bb9..c711b5bba 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -1625,8 +1625,11 @@ rspamd_smtp_received_parse (struct rspamd_task *task,
case RSPAMD_RECEIVED_PART_FOR:
rh->for_addr = rspamd_email_address_from_smtp (cur->data, cur->dlen);
- if (rh->for_addr) {
- rh->for_mbox = rh->for_addr->addr;
+ if (rh->for_addr && rh->for_addr->addr_len > 0) {
+ t1.begin = rh->for_addr->addr;
+ t1.len = rh->for_addr->addr_len;
+ rh->for_mbox = rspamd_mempool_ftokdup (task->task_pool,
+ &t1);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t)rspamd_email_address_free,