diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-28 15:16:35 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-28 15:16:35 +0100 |
commit | d99b1659638d0587be519a8a8c3dd3865447fe72 (patch) | |
tree | c8ab51f93110b02642f20e306dd45a9278e2d2fd | |
parent | 862dd50f1572827dfc50900cac72e5020b1634de (diff) | |
download | rspamd-d99b1659638d0587be519a8a8c3dd3865447fe72.tar.gz rspamd-d99b1659638d0587be519a8a8c3dd3865447fe72.zip |
[Minor] Another fix of raw access to headers structures
-rw-r--r-- | src/libmime/images.c | 9 |
1 files 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) { |