Bug 3977

Summary: Fix crashes when some external APIs fail
Product: Claws Mail (GTK 2) Reporter: Zhouyang <jiazhouyang09>
Component: PluginsAssignee: users
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 3.16.0   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
patch of the potential API bugs none

Description Zhouyang 2018-02-28 05: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 14:31:11 UTC
Good thing, you're right. Did you proof-test all the modified situations?
Comment 2 Zhouyang 2018-02-28 15: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 10: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