D28535: [KIO-MTP] Fix null pointer dereference

Alexander Saoutkin noreply at phabricator.kde.org
Fri Apr 3 15:11:53 BST 2020


feverfew added a comment.


  In D28535#640703 <https://phabricator.kde.org/D28535#640703>, @anthonyfieroni wrote:
  
  > In D28535#640699 <https://phabricator.kde.org/D28535#640699>, @feverfew wrote:
  >
  > > So to be succinct, the only correct fix here is to change `getDevice()` to `return m_mtpdevice`?
  >
  >
  > Yes, then check if it's crash, in all other places `LIBMTP_xxx` should take care of and return false or nullptr depend of function returning value.
  
  
  What do you mean by "then check if it's crash"? Surely we should do nothing and let LIBMTP sort out printing errors and stuff? Eventually the device should be reclaimed by the daemon anyway via the help of `Solid::deviceRemoved()`. I agree with everything after the comma though, `LIBMTP_mtpdevice_t *` should never be freed unless we explicitly do so ourselves.

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: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200403/54c4a702/attachment.html>


More information about the Kde-frameworks-devel mailing list