From 5b829f6cf33154f8a41664399a56ce9634fbe3ac Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 11 May 2018 17:39:12 +0100 Subject: [PATCH] [Fix] Allow to have multiple values for headers as arrays --- src/libserver/milter.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libserver/milter.c b/src/libserver/milter.c index 3f3772850..c08513ea6 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -1581,7 +1581,11 @@ rspamd_milter_process_milter_block (struct rspamd_milter_session *session, it = NULL; while ((cur = ucl_object_iterate (elt, &it, true)) != NULL) { - LL_FOREACH (cur, cur_elt) { + ucl_object_iter_t *elt_it; + + elt_it = ucl_object_iterate_new (cur); + + while ((cur_elt = ucl_object_iterate_safe (elt_it, true)) != NULL) { if (ucl_object_type (cur_elt) == UCL_STRING) { hname = g_string_new (ucl_object_key (cur)); hvalue = g_string_new (ucl_object_tostring (cur_elt)); @@ -1626,6 +1630,8 @@ rspamd_milter_process_milter_block (struct rspamd_milter_session *session, } } } + + ucl_object_iterate_free (elt_it); } } -- 2.39.5