Bug 3977 - Fix crashes when some external APIs fail
Summary: Fix crashes when some external APIs fail
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins (show other bugs)
Version: 3.16.0
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2018-02-28 04:53 UTC by Zhouyang
Modified: 2019-01-03 10:24 UTC (History)
0 users

See Also:


Attachments
patch of the potential API bugs (4.80 KB, patch)
2018-02-28 04:53 UTC, Zhouyang
no flags Details | Diff

Description Zhouyang 2018-02-28 04:53:33 UTC
Created attachment 1849 [details]
patch of the potential API bugs

Hi,

I'm a PhD student. I analyzed the claws source code and found some potential API bugs that may cause crashes.

These crashes are mainly caused by insufficient error handling of API functions like curl_easy_perform, gdk_keyboard_grab or pthread_create.

I think it's unsafe to assume the library function would be correct. It would be better if we could handle the error properly.

Attached please find the patch against version claws-mail-3.16.0. Hopefully, it can solve these potential bugs.

Best,
Zhouyang
Comment 1 wwp 2018-02-28 13:31:11 UTC
Good thing, you're right. Did you proof-test all the modified situations?
Comment 2 Zhouyang 2018-02-28 14:07:58 UTC
Yes, I have tested the modifications, and everything looks good.
I think the modified situations still need double checks, since I have limited domain knowledge on detailed code logic.
Comment 3 users 2019-01-03 09:40:05 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	2019-01-03 10:40:04.884976068 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=54e5f174d6651258b9e04617951c9dcba51f6467
Author: wwp <subscript@free.fr>
Date:   Thu Jan 3 10:36:37 2019 +0100

    Fix few (possible) crashes due to missing return code checks (patch
    by Zhouyang, with few modifications).
    
    Fixes bug #3977: Fix crshes when some external APIs fail

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