aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-04 15:48:14 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-03-04 15:48:14 +0000
commit274e0eebbc0bc88a0c87512843536a331aa2d168 (patch)
treec6d1de67f9c2edd760f1262ff27a50612c787802
parent5836e02b95696a39fc643e9c62ebd9c507634242 (diff)
downloadrspamd-274e0eebbc0bc88a0c87512843536a331aa2d168.tar.gz
rspamd-274e0eebbc0bc88a0c87512843536a331aa2d168.zip
[Fix] Fix deletion of the duplicate headers
-rw-r--r--src/libserver/milter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c
index 91e87c061..236a4bf75 100644
--- a/src/libserver/milter.c
+++ b/src/libserver/milter.c
@@ -1544,9 +1544,9 @@ rspamd_milter_remove_header_safe (struct rspamd_milter_session *session,
RSPAMD_MILTER_CHGHEADER,
nhdr, hname, hvalue);
}
- else if (nhdr == 0) {
+ else if (nhdr == 0 && ar->len > 0) {
/* We need to clear all headers */
- for (i = 1; i <= ar->len; i ++) {
+ for (i = ar->len; i > 0; i --) {
rspamd_milter_send_action (session,
RSPAMD_MILTER_CHGHEADER,
i, hname, hvalue);