Bug 2924 - Segmentation fault in nntp_disconnect_all() due to pointer truncation
Summary: Segmentation fault in nntp_disconnect_all() due to pointer truncation
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: NNTP (show other bugs)
Version: 3.9.1
Hardware: PC FreeBSD
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2013-05-13 16:02 UTC by Fabian Keil
Modified: 2013-05-13 16:27 UTC (History)
0 users

See Also:


Attachments
Fix segfault in nntp_disconnect_all() due to pointer truncation (559 bytes, patch)
2013-05-13 16:02 UTC, Fabian Keil
no flags Details | Diff

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 :)

Note You need to log in before you can comment on or make changes to this bug.