Project

General

Profile

Bug #12040

Fix crashes when some external APIs fail

Added by Zhouyang Jia over 1 year ago. Updated over 1 year ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
-
Target version:
Start date:
02/28/2018
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.1
System:
all
bitness:
64-bit
hardware architecture:
amd64/x86

Description

Hi,

I'm a PhD student. I analyzed the darktable 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 g_dir_open, curl_easy_perform 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 darktable-2.4.1. Hopefully, it can solve these potential bugs.

Best,
Zhouyang

api_bugs_darktable-2.4.1.patch (2.62 KB) api_bugs_darktable-2.4.1.patch patch of the potential API bugs Zhouyang Jia, 02/28/2018 04:31 PM

Associated revisions

Revision 052649e9 (diff)
Added by Tobias Ellinghaus over 1 year ago

Fix #12040: Add some error handling

Thank you Zhouyang Jia for finding these and proposing the patch.

Revision e2237e2e (diff)
Added by Tobias Ellinghaus over 1 year ago

Fix #12040: Add some error handling

Thank you Zhouyang Jia for finding these and proposing the patch.

(cherry picked from commit 052649e9e7a708c84ca85cc68115ec7e0e30e58a)

History

#1 Updated by Tobias Ellinghaus over 1 year ago

In general I agree, more error handling won't hurt.

About your changes, the result of g_dir_open in film.c is already checked later, and glib functions have their own error handling and don't use errno. The change to rawspeed needs to be proposed upstream, we are just bundling that lib. I'll manually merge the changes. Thank you.

#2 Updated by Tobias Ellinghaus over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from New to Fixed

#3 Updated by Roman Lebedev over 1 year ago

  • Target version set to 2.6.0

Also available in: Atom PDF

Go to top