Bug 3364 - segfault in src/prefs_account.c
Summary: segfault in src/prefs_account.c
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: UI (show other bugs)
Version: 3.11.1
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2015-01-14 16:02 UTC by Michael Schwendt
Modified: 2015-01-15 23:17 UTC (History)
0 users

See Also:


Attachments
Fix proposal (1.21 KB, patch)
2015-01-14 16:39 UTC, Ricardo Mones
no flags Details | Diff

Description Michael Schwendt 2015-01-14 16:02:09 UTC
http://git.claws-mail.org/?p=claws.git;a=blob;f=src/prefs_account.c;h=934a1cf6d562ba3d51332ee9363a3f029878ccb4;hb=HEAD#l3847

3847         if (strchr(address, '@') == NULL) {
3848                 g_free(address);
3849                 gtk_label_set_text(GTK_LABEL(basic_page.auto_configure_lbl),
3850                            _("Failed (wrong address)"));
3851         }
3852         domain = strchr(address, '@') + 1;

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

https://bugzilla.redhat.com/1182146
Comment 1 Ricardo Mones 2015-01-14 16:39:15 UTC
Created attachment 1470 [details]
Fix proposal

The attached patch fixes it for me (and the double free while we're at it ;-)
Comment 2 users 2015-01-14 16:50:02 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

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