diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-11-28 06:16:34 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2013-11-28 06:16:34 +0000 |
commit | 8e6db027fbf2f65ccf54767179d8b13ef7678427 (patch) | |
tree | c528d0a568385544e8fa5ddbb3028a1d2daef877 | |
parent | 4d55b43fe6f1c786865dddd6a6e1efd82d10f54f (diff) |
added more null checks.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3306 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/summaryview.c | 6 | ||||
-rw-r--r-- | src/textview.c | 6 |
3 files changed, 14 insertions, 4 deletions
@@ -1,6 +1,12 @@ 2013-11-28 * libsylph/ssl.c: ssl_done(): check if fp != NULL. + * src/textview.c: + textview_popup_menu_activate_open_uri_cb(): + textview_event_after(): + prevent null dereference of msginfo. + * src/summaryview.c: summary_unthread(): first check if + summaryview->folder_item is non-null. 2013-11-28 diff --git a/src/summaryview.c b/src/summaryview.c index bac678f1..db6a7eee 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -4460,6 +4460,9 @@ void summary_unthread(SummaryView *summaryview) FolderSortType sort_type = SORT_ASCENDING; MsgInfo *selected_msg, *displayed_msg; + if (!summaryview->folder_item) + return; + summary_lock(summaryview); debug_print(_("Unthreading...")); @@ -4474,8 +4477,7 @@ void summary_unthread(SummaryView *summaryview) displayed_msg = summary_get_msginfo (summaryview, summaryview->displayed); - if (summaryview->folder_item) - summaryview->folder_item->threaded = FALSE; + summaryview->folder_item->threaded = FALSE; if (summaryview->folder_item->sort_key != SORT_BY_NONE) { sort_key = summaryview->folder_item->sort_key; diff --git a/src/textview.c b/src/textview.c index 7f84f337..e55eea9e 100644 --- a/src/textview.c +++ b/src/textview.c @@ -2301,7 +2301,8 @@ static gboolean textview_event_after(GtkWidget *widget, GdkEvent *event, ac = account_find_from_item(msginfo->folder); if (ac && ac->protocol == A_NNTP) ac = NULL; - compose_new(ac, msginfo->folder, uri->uri + 7, NULL); + compose_new(ac, msginfo ? msginfo->folder : NULL, + uri->uri + 7, NULL); } else if (uri->uri[0] == '#') { /* don't open in-page link */ } else if (textview_uri_security_check(textview, uri) == TRUE) @@ -2540,7 +2541,8 @@ static void textview_popup_menu_activate_open_uri_cb(GtkMenuItem *menuitem, ac = account_find_from_item(msginfo->folder); if (ac && ac->protocol == A_NNTP) ac = NULL; - compose_new(ac, msginfo->folder, uri->uri + 7, NULL); + compose_new(ac, msginfo ? msginfo->folder : NULL, + uri->uri + 7, NULL); } else if (uri->uri[0] == '#') { /* don't open in-page link */ } else if (textview_uri_security_check(textview, uri) == TRUE) |