[Commits] [SCM] claws branch, master, updated. 3.17.0-200-gd76f8ac

ticho at claws-mail.org ticho at claws-mail.org
Wed Dec 12 19:47:41 CET 2018


The branch, master has been updated
       via  d76f8acd074e1393936923dcfaa7f85a74e00587 (commit)
      from  662b8d1b5d7a7a767d90a585367b852fe3312374 (commit)

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


- Log -----------------------------------------------------------------
commit d76f8acd074e1393936923dcfaa7f85a74e00587
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Dec 12 19:43:13 2018 +0100

    Handle corner case in news_get_extra_fields() where msglist is empty
    
    This makes the function quit early, instead of requesting
    XHDR with bogus ranges from the server.
    
    Closes bug #4133: trying to read message from an NNTP group (with
    all expired articles.

diff --git a/src/news.c b/src/news.c
index 61120c4..634a050 100644
--- a/src/news.c
+++ b/src/news.c
@@ -1125,6 +1125,9 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
 	cm_return_if_fail(item->folder != NULL);
 	cm_return_if_fail(FOLDER_CLASS(item->folder) == &news_class);
 
+	if (msglist == NULL)
+		return;
+
 	news_folder_lock(NEWS_FOLDER(item->folder));
 
 	hash_table = g_hash_table_new(g_direct_hash, g_direct_equal);
@@ -1139,6 +1142,11 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
 				GINT_TO_POINTER(msginfo->msgnum), msginfo);
 	}
 
+	if (first == -1 || last == -1) {
+		g_hash_table_destroy(hash_table);
+		return;
+	}
+
 /* Newsgroups */
 	ok = nntp_threaded_xhdr(item->folder, "newsgroups", first, last, &hdrlist);
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list