Bug 405838

Summary: KIOD5 crashes if user disconnects MTP device during copeing
Product: [Frameworks and Libraries] kio-extras Reporter: Mike Krutov <nekoxmachina>
Component: MTPAssignee: Elvis Angelaccio <elvis.angelaccio>
Status: RESOLVED FIXED    
Severity: normal CC: germano.massullo
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: crash log

Description Mike Krutov 2019-03-24 21:32:56 UTC
Created attachment 119010 [details]
crash log

SUMMARY


STEPS TO REPRODUCE
1. Start copying data to MTP device 
2. During copy operation, disconnect device
3. Bam

OBSERVED RESULT
Crash

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.0

ADDITIONAL INFORMATION
Comment 1 a.saoutkin 2020-04-13 12:08:56 UTC
Git commit 94e7b64325f9e71196a19fb5bc396b9e82f88fc7 by Alexander Saoutkin.
Committed on 13/04/2020 at 12:11.
Pushed by asaoutkin into branch 'master'.

[KIO-MTP] Fix null pointer dereference

Summary:
A null pointer can be returned from getDevice() if a device is disconnected.
Passing NULL into LIBMTP_Get_Storage() results in a NULL pointer dereference.

Test Plan:
Compiles. I couldn't reproduce this as described in the bug report, but from
reading the attached stacktrace in the bug report it's obvious what went wrong
here.

Reviewers: akrutzler, dfaure, elvisangelaccio

Reviewed By: elvisangelaccio

Subscribers: anthonyfieroni, kde-frameworks-devel, fvogt, kfm-devel, ngraham

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D28535

M  +0    -6    mtp/kiod_module/mtpdevice.cpp

https://commits.kde.org/kio-extras/94e7b64325f9e71196a19fb5bc396b9e82f88fc7
Comment 2 Harald Sitter 2022-01-06 12:59:01 UTC
*** Bug 412159 has been marked as a duplicate of this bug. ***