aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-24 11:59:40 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-24 11:59:40 +0000
commitcfdf17ea1a26abce66d11319a02faaa33132cf9e (patch)
tree43e500a7a2837d3a02d779c7ca244b3d50ae0d6b /src/libmime
parente0e0d361a445a4f5cca9bdc77a23dbdfe75bebed (diff)
downloadrspamd-cfdf17ea1a26abce66d11319a02faaa33132cf9e.tar.gz
rspamd-cfdf17ea1a26abce66d11319a02faaa33132cf9e.zip
[Fix] Avoid collisions in mempool variables by changing fuzzy caching logic
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/message.c2
-rw-r--r--src/libmime/message.h2
-rw-r--r--src/libmime/mime_parser.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index e5f244a3e..a43e109b5 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -901,7 +901,7 @@ rspamd_message_from_data (struct rspamd_task *task, const guchar *start,
part->raw_data.len = len;
part->parsed_data.begin = start;
part->parsed_data.len = len;
- part->id = MESSAGE_FIELD (task, parts)->len;
+ part->part_number = MESSAGE_FIELD (task, parts)->len;
part->raw_headers = rspamd_message_headers_new ();
part->headers_order = NULL;
diff --git a/src/libmime/message.h b/src/libmime/message.h
index eeba0a053..91d6e13d4 100644
--- a/src/libmime/message.h
+++ b/src/libmime/message.h
@@ -97,7 +97,7 @@ struct rspamd_mime_part {
enum rspamd_cte cte;
guint flags;
enum rspamd_mime_part_type part_type;
- guint id;
+ guint part_number;
union {
struct rspamd_mime_multipart *mp;
diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c
index ce8162401..91df7e684 100644
--- a/src/libmime/mime_parser.c
+++ b/src/libmime/mime_parser.c
@@ -611,7 +611,7 @@ rspamd_mime_parse_normal_part (struct rspamd_task *task,
g_assert_not_reached ();
}
- part->id = MESSAGE_FIELD (task, parts)->len;
+ part->part_number = MESSAGE_FIELD (task, parts)->len;
g_ptr_array_add (MESSAGE_FIELD (task, parts), part);
msg_debug_mime ("parsed data part %T/%T of length %z (%z orig), %s cte",
&part->ct->type, &part->ct->subtype, part->parsed_data.len,
@@ -945,7 +945,7 @@ rspamd_mime_parse_multipart_part (struct rspamd_task *task,
return RSPAMD_MIME_PARSE_NESTING;
}
- part->id = MESSAGE_FIELD (task, parts)->len;
+ part->part_number = MESSAGE_FIELD (task, parts)->len;
g_ptr_array_add (MESSAGE_FIELD (task, parts), part);
st->nesting ++;
rspamd_mime_part_get_cte (task, part->raw_headers, part, FALSE);