Fix null pointer dereference, keep FileModifyJob metadata and serialize with options.
ClosedPublic

Authored by barchiesi on Sep 29 2019, 6:24 PM.

Details

Summary

This patch fixes a couple issues regarding FileAbstractUploadJob and FileModifyJob:

  • Fix null pointer dereference that was causing BUG 411634. This was introduced in D22787: Use mimeType from metadata instead of blindly re-determining it during uploads and in the affected block of code the mime-type must be determined by LibKGAPI as no File metadata was provided.
  • Pass File metadata from FileModifyJob ctor to FileAbstractUploadJob ctor. This was letting KIO GDrive trigger the above bug when trying to specify the modified files mime-type.
  • Use provided serialization options also in FilePtr serialization during building multipart request.

BUG: 411634

Diff Detail

Repository
R477 KGAPI Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
barchiesi created this revision.Sep 29 2019, 6:24 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptSep 29 2019, 6:24 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
barchiesi requested review of this revision.Sep 29 2019, 6:24 PM
barchiesi added a project: LibKGAPI.
barchiesi added a subscriber: LibKGAPI.

Regarding point 1, mea culpa 😬

dvratil accepted this revision.Oct 1 2019, 11:37 AM

Thanks for the fix. Since this is a bugfix, please land this patch to the Applications/19.08 branch, then merge the branch to master.

This revision is now accepted and ready to land.Oct 1 2019, 11:37 AM
This revision was automatically updated to reflect the committed changes.