diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-25 15:41:16 +0200 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-25 15:42:08 +0200 |
commit | 69b6d5fd0ad7e1e033298ac9c55de2c8ae9e18fa (patch) | |
tree | aa8246e6715cee20da91ce51d2b5fd177bc7c08d /src | |
parent | d73315f9bbeead0a7dd5a2ff50463f675a2b404b (diff) | |
download | rspamd-69b6d5fd0ad7e1e033298ac9c55de2c8ae9e18fa.tar.gz rspamd-69b6d5fd0ad7e1e033298ac9c55de2c8ae9e18fa.zip |
[CritFix] Fix iteration over headers array (introduced in 1.4)
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/message.c | 4 | ||||
-rw-r--r-- | src/libutil/util.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index ca05dc4c8..5b14c6f9e 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -60,14 +60,14 @@ append_raw_header (struct rspamd_task *task, if ((ar = g_hash_table_lookup (target, rh->name)) != NULL) { g_ptr_array_add (ar, rh); + msg_debug_task ("append raw header %s: %s", rh->name, rh->value); } else { ar = g_ptr_array_sized_new (2); g_ptr_array_add (ar, rh); g_hash_table_insert (target, rh->name, ar); + msg_debug_task ("add new raw header %s: %s", rh->name, rh->value); } - - msg_debug_task ("add raw header %s: %s", rh->name, rh->value); } /* Convert raw headers to a list of struct raw_header * */ diff --git a/src/libutil/util.h b/src/libutil/util.h index 8bee11b5f..da10e419a 100644 --- a/src/libutil/util.h +++ b/src/libutil/util.h @@ -507,5 +507,5 @@ gpointer rspamd_shmem_xmap (const char *fname, guint mode, */ gdouble rspamd_normalize_probability (gdouble x, gdouble bias); -#define PTR_ARRAY_FOREACH(ar, i, cur) if (ar != NULL) for ((i) = 0, (cur) = g_ptr_array_index((ar), 0); (i) < (ar)->len; (cur) = g_ptr_array_index((ar), (i)), ++(i)) +#define PTR_ARRAY_FOREACH(ar, i, cur) if (ar != NULL) for ((i) = 0, (cur) = g_ptr_array_index((ar), 0); (i) < (ar)->len; (cur) = g_ptr_array_index((ar), (i + 1)), ++(i)) #endif |