Bug 3857 - crash when setting a wrong host
Summary: crash when setting a wrong host
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/Clamd (show other bugs)
Version: 3.15.0
Hardware: All All
: P3 critical
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2017-08-04 10:24 UTC by Zhouyang
Modified: 2018-02-09 21:04 UTC (History)
0 users

See Also:


Attachments
fix the crash by adding error handling code to gethostbyname (671 bytes, application/octet-stream)
2017-08-04 10:24 UTC, Zhouyang
no flags Details

Description Zhouyang 2017-08-04 10:24:20 UTC
Created attachment 1774 [details]
fix the crash by adding error handling code to gethostbyname

The program will crash when setting a wrong host.

Steps to reproduce:

1. Load the plugin.
Configuration -> Plugins -> Load -> clams.so -> Open -> Close

2. Set a wrong host name.
Configuration -> Preferences -> Plugins -> Clam AntiVirus -> check Enable virus scanning -> uncheck Automatic configuration -> Remote Host: WrongHost -> Port: 10010 -> Apply

The reason is that there is no error handling code after calling function "gethostbyname". 

The following patch will solve this problem.
Comment 1 Michael Rasmussen 2017-08-04 12:21:47 UTC
This patch does not seem to completely solve the problem. Applying patch simply make claws crash somewhere else with the following error message:
Process terminating with default action of signal 5 (SIGTRAP)

I will have to investigate further.
Comment 2 users 2018-02-09 20:48: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	2018-02-09 20:48:04.083112687 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=54033a1a46c19cb83c367699c705d7796463c9c5
Merge: 1c89c21 8036059
Author: Colin Leroy <colin@colino.net>
Date:   Fri Feb 9 20:48:03 2018 +0100

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

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=80360594f0d55125e97a4831e46fea08b08e95be
Author: Michael Rasmussen <mir@datanom.net>
Date:   Fri Feb 9 20:46:54 2018 +0100

    Forgotten changes in commit 09301b6e73e4af1b03b6f19d340dd909cf527bcc
    
    Signed-off-by: Michael Rasmussen <mir@datanom.net>

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=d1c488269e3244759b921c041c77bcd198282af0
Merge: 2ae542a 09301b6
Author: Michael Rasmussen <mir@datanom.net>
Date:   Fri Feb 9 20:40:26 2018 +0100

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=2ae542a77b687501c99fb4204a71d92abe6efce0
Merge: bc4915b a4b3b84
Author: Michael Rasmussen <mir@datanom.net>
Date:   Mon Nov 27 22:51:59 2017 +0100

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=bc4915bb92508d919130ad229d8483324b82f039
Merge: 39be80d 8e9f89b
Author: Michael Rasmussen <mir@datanom.net>
Date:   Thu Nov 16 17:18:24 2017 +0100

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=39be80dde52ad1b5815fc14af5bec39068ee55d9
Merge: 22249a5 51805d8
Author: Michael Rasmussen <mir@datanom.net>
Date:   Fri Oct 27 16:45:01 2017 +0200

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=22249a5bdbc5930c0a3069804ba9cdf35ec07dec
Merge: c034331 3bce048
Author: Michael Rasmussen <mir@datanom.net>
Date:   Sat Sep 23 22:55:25 2017 +0200

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=c03433163c1b3d0d9aaefc82c7c5a5fa2c413a58
Merge: 7ee8518 2bc71e4
Author: Michael Rasmussen <mir@datanom.net>
Date:   Tue Aug 29 23:07:36 2017 +0200

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=7ee8518c9e2538f4c857e4d94dfcb2718edde48c
Merge: 29ecadc 404c674
Author: Michael Rasmussen <mir@datanom.net>
Date:   Sat Aug 26 23:56:30 2017 +0200

    Merge branch 'master' of ssh+git://git.claws-mail.org/home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=29ecadc1cb6d568b5a23e06d9256c0a714cb51a7
Author: Zhouyang <jiazhouyang09@gmail.com>
Date:   Fri Aug 4 11:53:26 2017 +0200

    Fix bug #3857: Thanks to Zhouyang
    
    Signed-off-by: Michael Rasmussen <mir@datanom.net>

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