D28535: [KIO-MTP] Fix null pointer dereference

Anthony Fieroni noreply at phabricator.kde.org
Fri Apr 3 12:47:29 BST 2020


anthonyfieroni added a comment.


  In D28535#640672 <https://phabricator.kde.org/D28535#640672>, @fvogt wrote:
  
  > If `getDevice()` returns nullptr, this means that `MTPDevice::getDevice()` returns nullptr. This can only happen if `m_mtpdevice` is nullptr, which will crash in `MTPDevice::~MTPDevice` sooner or later anyway.
  
  
  I don't think so, libmtp knows device is not available then `LIBMTP_Release_Device` (invalid device) will not crash. So i prefer to cache device in storage as well so libmtp will just return false on invalid device.

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D28535

To: feverfew, akrutzler, dfaure, elvisangelaccio
Cc: anthonyfieroni, kde-frameworks-devel, fvogt, kfm-devel, ngraham, nikolaik, pberestov, iasensio, fprice, LeGast00n, cblack, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, andrebarros, bruns, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200403/b3d5c616/attachment.htm>


More information about the kfm-devel mailing list