[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-745-ge171555

ticho at claws-mail.org ticho at claws-mail.org
Tue May 14 16:04:00 CEST 2019


The branch, gtk3 has been updated
       via  e171555264ae7d84ba7073cc29a0fee9a3149bb6 (commit)
      from  56d48f8c2d0b3b88b9b1b5512f114f1151a51f15 (commit)

Summary of changes:
 src/messageview.c |    6 ++++++
 1 file changed, 6 insertions(+)


- Log -----------------------------------------------------------------
commit e171555264ae7d84ba7073cc29a0fee9a3149bb6
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Tue May 14 16:01:40 2019 +0200

    Fix a use after free crash when deleting message via a separate messageview
    
    After the message has been deleted, summary_show() will
    redisplay the folder and free all the MsgInfos, but we still
    need the one for the message currently displayed in our
    messageview window, so we add our own reference to it, and free
    it ourselves when we're done.
    
    This was only happening when summaryview already has a different
    message displayed.
    
    Fixes bug #4029: segfault after deleting message in a window

diff --git a/src/messageview.c b/src/messageview.c
index 7eff0ae..f305a4a 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -1667,6 +1667,10 @@ void messageview_delete(MessageView *msgview)
 
 		cm_return_if_fail(msginfo != NULL);
 
+		/* We will need to access the original message's msginfo
+		 * later, so we add our own reference. */
+		procmsg_msginfo_new_ref(msginfo);
+
 		/* to get the trash folder, we have to choose either
 		 * the folder's or account's trash default - we prefer
 		 * the one in the account prefs */
@@ -1690,6 +1694,8 @@ void messageview_delete(MessageView *msgview)
 			procmsg_msginfo_set_flags(msginfo, MSG_DELETED, 0);
 			/* NOTE: does not update to next message in summaryview */
 		}
+
+		procmsg_msginfo_free(&msginfo);
 	}
 #ifdef GENERIC_UMPC
 	if (msgview->window && !prefs_common.always_show_msg) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list