commit 8868de1: [Minor] Fix parsing of the query arguments

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Jul 16 15:28:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-16 14:46:57 +0100
URL: https://github.com/rspamd/rspamd/commit/8868de1133e8641bec9218858528b1f175bd10c1

[Minor] Fix parsing of the query arguments

---
 src/libserver/protocol.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 4a470e3f0..8c5cd4080 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -204,11 +204,14 @@ rspamd_protocol_handle_url (struct rspamd_task *task,
 		g_hash_table_iter_init (&it, query_args);
 
 		while (g_hash_table_iter_next (&it, &k, &v)) {
+			gchar *key_cpy;
 			key = k;
 			value = v;
-			/* Steal strings */
-			g_hash_table_iter_steal (&it);
-			rspamd_task_add_request_header (task, key, value);
+
+			key_cpy = rspamd_mempool_ftokdup (task->task_pool, key);
+
+			rspamd_http_message_add_header_len (msg, key_cpy,
+					value->begin, value->len);
 			msg_debug_protocol ("added header \"%T\" -> \"%T\" from HTTP query",
 					key, value);
 		}


More information about the Commits mailing list