Bug 3365

Summary: segfault in src/wizard.c
Product: Claws Mail (GTK 2) Reporter: Michael Schwendt <mschwendt>
Component: UIAssignee: users
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 3.11.1   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Fix proposal none

Description Michael Schwendt 2015-01-14 16:07:18 UTC
http://git.claws-mail.org/?p=claws.git;a=blob;f=src/wizard.c;h=717bb9fd0581adc47e3232c5e78dcceef8ba5867;hb=HEAD#l1371

1371         if (strchr(address, '@') == NULL) {
1372                 g_free(address);
1373                 gtk_label_set_text(GTK_LABEL(wizard->auto_configure_lbl),
1374                            _("Failed (wrong address)"));
1375         }
1376         domain = strchr(address, '@') + 1;

1388                         recv_data->domain = g_strdup(domain);

The error-handling for the case "no @ found in address" frees the address ptr, but accesses it in lines 1376 and 1388 again. domain ptr becomes 0x1 causing a crash.

https://bugzilla.redhat.com/1123895
Comment 1 Ricardo Mones 2015-01-14 16:40:48 UTC
Created attachment 1471 [details]
Fix proposal

Analogous fix(es) from 3364 for the wizard.c
Comment 2 users 2015-01-14 16:50:04 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2015-01-14 16:50:02.435589581 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=00729e26d5d3e849874f45a59ddd578a43860b62
Merge: 0a0b2b2 c0810db
Author: Colin Leroy <colin@colino.net>
Date:   Wed Jan 14 16:50:01 2015 +0100

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=c0810db8bfb77999ceae738e88c7ff11352bb366
Author: Colin Leroy <colin@colino.net>
Date:   Wed Jan 14 16:46:21 2015 +0100

    Fix bug #3364, segfault in src/wizard.c: add missing return
    Fix bug #3365, segfault in src/prefs_account.c: add missing return