From d99b1659638d0587be519a8a8c3dd3865447fe72 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 28 Sep 2016 15:16:35 +0100 Subject: [PATCH] [Minor] Another fix of raw access to headers structures --- src/libmime/images.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libmime/images.c b/src/libmime/images.c index f2c27f865..f269bb2d6 100644 --- a/src/libmime/images.c +++ b/src/libmime/images.c @@ -199,6 +199,7 @@ process_image (struct rspamd_task *task, struct rspamd_mime_part *part) struct html_image *himg; const gchar *cid, *html_cid; guint cid_len, i, j; + GPtrArray *ar; if ((type = detect_image_type (part->content)) != IMAGE_TYPE_UNKNOWN) { switch (type) { @@ -231,13 +232,17 @@ process_image (struct rspamd_task *task, struct rspamd_mime_part *part) part->specific_data = img; /* Check Content-Id */ - rh = g_hash_table_lookup (part->raw_headers, "Content-Id"); + ar = rspamd_message_get_header_from_hash (part->raw_headers, + task->task_pool, "Content-Id", FALSE); - if (rh != NULL) { + if (ar != NULL && ar->len > 0) { + rh = g_ptr_array_index (ar, 0); cid = rh->decoded; + if (*cid == '<') { cid ++; } + cid_len = strlen (cid); if (cid_len > 0) { -- 2.39.5