Bug 2924

Summary: Segmentation fault in nntp_disconnect_all() due to pointer truncation
Product: Claws Mail (GTK 2) Reporter: Fabian Keil <fk>
Component: NNTPAssignee: users
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 3.9.1   
Hardware: PC   
OS: FreeBSD   
Attachments:
Description Flags
Fix segfault in nntp_disconnect_all() due to pointer truncation none

Description Fabian Keil 2013-05-13 16:02:43 UTC
Created attachment 1260 [details]
Fix segfault in nntp_disconnect_all() due to pointer  truncation

claws-mail 3.9.1 reproducible segfaults on exit on my system when compiled with NNTP support.

Apparently the pointer returned by account_get_list() is truncated to an integer due to a missing function definition:

(gdb) r
Starting program: /usr/local/bin/claws-mail 
[New LWP 101084]
[New Thread 80ac06400 (LWP 101084)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 80ac06400 (LWP 101084)]
0x00000000005331f9 in nntp_disconnect_all (have_connectivity=1) at news.c:1418
1418		for (list = account_get_list(); list != NULL; list = list->next) {
(gdb) where
#0  0x00000000005331f9 in nntp_disconnect_all (have_connectivity=1) at news.c:1418
#1  0x0000000000669cf3 in nntp_main_done (have_connectivity=1) at nntp-thread.c:163
#2  0x00000000004e59aa in exit_claws (mainwin=0x80acf23c0) at main.c:1811
#3  0x00000000004e2627 in main (argc=1, argv=0x7fffffffd8b0) at main.c:1739
(gdb) p list
$1 = (GList *) 0xb836a00

The attached patch fixes the issue for me.
Comment 1 Colin Leroy 2013-05-13 16:27:10 UTC
Thanks for the patch; it's in GIT already :)