diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-01-22 19:07:50 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-01-22 19:07:50 +0000 |
commit | b1299ac9108f4568959a2ef61d2f7992ee131c88 (patch) | |
tree | 50bc5fdf2123df5c13dd573657afefaa89c3b55b | |
parent | c7c901ef4b30cc3130f9c90a940f7e7f73de8a22 (diff) | |
download | rspamd-b1299ac9108f4568959a2ef61d2f7992ee131c88.tar.gz rspamd-b1299ac9108f4568959a2ef61d2f7992ee131c88.zip |
[Fix] Fix headers insertion in the ordered list
-rw-r--r-- | src/libmime/mime_headers.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index 1cbc57881..2bd559d4f 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -1,5 +1,5 @@ /* - * Copyright 2023 Vsevolod Stakhov + * Copyright 2024 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1121,7 +1121,11 @@ void rspamd_message_set_modified_header(struct rspamd_task *task, kh_value(htb, k) = hdr_elt; if (order_ptr) { - DL_APPEND(*order_ptr, hdr_elt); + /* + * This iterates over all headers in O(N), but we have no other options here, as the + * list is already set. + */ + LL_APPEND2(*order_ptr, hdr_elt, ord_next); } } else { |