diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-02-23 21:08:42 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-02-23 21:08:42 +0000 |
commit | 752d619ceb5d0fb9d4e938e4f8f346ad2c1f3629 (patch) | |
tree | 861ed880305058632b181a2d1514096ba6280e2d | |
parent | 6b6ab33419d22d07230a2cd3b8b9d911e1df1470 (diff) | |
download | rspamd-752d619ceb5d0fb9d4e938e4f8f346ad2c1f3629.tar.gz rspamd-752d619ceb5d0fb9d4e938e4f8f346ad2c1f3629.zip |
[Minor] Fix several issues
-rw-r--r-- | src/libmime/mime_headers.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index 1677bb349..9137e29de 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -1842,8 +1842,8 @@ rspamd_message_set_modified_header (struct rspamd_task *task, * This implies an additional copy of all structures but is safe enough to * deal with it */ - cur_hdr->flags |= RSPAMD_HEADER_MODIFIED; - cur_hdr->modified_chain = NULL; + hdr_elt->flags |= RSPAMD_HEADER_MODIFIED; + hdr_elt->modified_chain = NULL; gint new_chain_length = 0; PTR_ARRAY_FOREACH (existing_ar, i, cur_hdr) { @@ -1856,7 +1856,7 @@ rspamd_message_set_modified_header (struct rspamd_task *task, nhdr->next = NULL; nhdr->ord_next = NULL; - DL_APPEND (cur_hdr->modified_chain, nhdr); + DL_APPEND (hdr_elt->modified_chain, nhdr); new_chain_length ++; } } @@ -1924,13 +1924,13 @@ rspamd_message_set_modified_header (struct rspamd_task *task, DL_APPEND (hdr_elt->modified_chain, nhdr); } else if (ord > 0) { - while (ord > 0 && (*pos) && (*pos)->next) { + while (ord > 0 && (*pos)) { ord --; pos = &((*pos)->next); } if (*pos) { /* pos is &(elt)->next */ - nhdr->next = (*pos)->next; + nhdr->next = (*pos); nhdr->prev = (*pos)->prev; (*pos)->prev = nhdr; *pos = nhdr; |