From: Vsevolod Stakhov Date: Fri, 11 May 2018 16:39:12 +0000 (+0100) Subject: [Fix] Allow to have multiple values for headers as arrays X-Git-Tag: 1.7.5~47 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b829f6cf33154f8a41664399a56ce9634fbe3ac;p=rspamd.git [Fix] Allow to have multiple values for headers as arrays --- 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); } }