]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Another fix of raw access to headers structures
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 28 Sep 2016 14:16:35 +0000 (15:16 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 28 Sep 2016 14:16:35 +0000 (15:16 +0100)
src/libmime/images.c

index f2c27f8652f074ecda56e0d7f6f81f26e9c3ff91..f269bb2d6cd052350bd186400bb1f542fce0c8ab 100644 (file)
@@ -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) {