commit ca75670: [Minor] Do copy as this value will be modified

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 9 09:49:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-07-09 10:41:41 +0100
URL: https://github.com/rspamd/rspamd/commit/ca75670ee0f606734170f39d2cb1b63beb3780be (HEAD -> master)

[Minor] Do copy as this value will be modified

---
 src/libmime/mime_headers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index c1d5f397c..8f229a9b3 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -416,8 +416,8 @@ rspamd_mime_headers_process (struct rspamd_task *task,
 			break;
 		case 5:
 			/* Header has only name, no value */
-			nh->value = "";
-			nh->decoded = "";
+			nh->value = rspamd_mempool_strdup (task->task_pool, "");;
+			nh->decoded = rspamd_mempool_strdup (task->task_pool, "");;
 			nh->raw_len = p - nh->raw_value;
 			nh->order = norder ++;
 			rspamd_mime_header_add (task, &target->htb, order_ptr, nh, check_newlines);


More information about the Commits mailing list