Bug 3939

Summary: XHDR newsgroups command endless loop
Product: Claws Mail (GTK 2) Reporter: Jean Diraison <jean.diraison>
Component: NNTPAssignee: users
Status: RESOLVED DUPLICATE    
Severity: normal CC: jean.diraison
Priority: P3    
Version: 3.16.0   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Manage -1 end special value in nntp_threaded_xhdr nntp_threaded_over
none
Manage -1 end special value in nntp_threaded_xhdr nntp_threaded_over none

Description Jean Diraison 2017-12-23 02:57:40 UTC
Created attachment 1829 [details]
Manage -1 end special value in nntp_threaded_xhdr nntp_threaded_over

The XHDR newsgroups command keeps downloading data forever in some case.

This happens when nntp_threaded_xhdr() function [src/etpan/nntp-thread.c] is called with "end" parameter equal to 0xffffffff = (guint32)-1. The condition in the while loop is always true (cbeg <= end && cend <= end).

I have experienced this problem with groups where last article has been deleted (for example server: richelieu.ac-versailles.fr:119  group: ac-versailles.vie-du-reseau.discussions ).

When this occurs, the XOVER command returns no data. So "newlist" stay NULL in news_get_msginfos_for_range() function [src/news.c]. In this case, the "first" and "last" signed integers are equals to -1 in news_get_extra_fields() function, and they are converted to unsigned 32 bits integers 0xffffffff in nntp_threaded_xhdr() call [src/etpan/nntp-thread.c].



I don't know what is the best way to solve this problem:
* return from news_get_extra_fields() if msglist is NULL
* or manage -1 special case values in nntp_threaded_xhdr() to keep previous behavior (by comparing values + ones)
Comment 1 Jean Diraison 2017-12-23 03:01:23 UTC
Created attachment 1830 [details]
Manage -1 end special value in nntp_threaded_xhdr nntp_threaded_over
Comment 2 Andrej Kacian 2019-01-02 20:30:56 UTC

*** This bug has been marked as a duplicate of bug 4133 ***