Fix CID#1436912: Dereferencing null pointer "msginfo->folder"
authorRicardo Mones <ricardo@mones.org>
Mon, 11 Jun 2018 10:31:29 +0000 (12:31 +0200)
committerRicardo Mones <ricardo@mones.org>
Mon, 11 Jun 2018 10:31:29 +0000 (12:31 +0200)
src/messageview.c

index 558ab6b..8441aef 100644 (file)
@@ -1537,8 +1537,8 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
                        }
                        messageview_find_part_depth_first(&context, MIMETYPE_TEXT, "html");
                        if (context.found &&
                        }
                        messageview_find_part_depth_first(&context, MIMETYPE_TEXT, "html");
                        if (context.found &&
-                           (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS ||
-                            (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT &&
+                           ((msginfo->folder && msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS) ||
+                            ((msginfo->folder && msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT) &&
                              prefs_common.promote_html_part))) { /* html found */
                                mimeinfo = context.found;
                                if (messageview_try_select_mimeinfo(messageview, msginfo, mimeinfo))
                              prefs_common.promote_html_part))) { /* html found */
                                mimeinfo = context.found;
                                if (messageview_try_select_mimeinfo(messageview, msginfo, mimeinfo))