Bug 411634 - kio-gdrive crash when saving file from text editor
Summary: kio-gdrive crash when saving file from text editor
Status: RESOLVED FIXED
Alias: None
Product: libkgapi
Classification: Frameworks and Libraries
Component: drive (show other bugs)
Version: GIT
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: David Barchiesi
URL:
Keywords:
: 412791 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-09-06 05:51 UTC by larmoe
Modified: 2019-10-20 10:35 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.08.2


Attachments
debig info (8.76 KB, text/plain)
2019-09-06 05:51 UTC, larmoe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description larmoe 2019-09-06 05:51:25 UTC
Created attachment 122510 [details]
debig info

SUMMARY


STEPS TO REPRODUCE
1. Open txt/odt etc. file from google drive in Dolphin 
2. Edit file
3. kio-gdrive crash when saving file from text editor

OBSERVED RESULT
File is not saved to google drive

EXPECTED RESULT
Expected file to be saved

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.61.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
Comment 1 David Barchiesi 2019-10-01 12:09:48 UTC
Git commit 2cbbdda752270cb505465eb789938fbd0fa3ae51 by David Barchiesi.
Committed on 01/10/2019 at 12:01.
Pushed by barchiesi into branch 'Applications/19.08'.

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

Summary:
This patch fixes a couple issues regarding FileAbstractUploadJob and FileModifyJob:
- Fix null pointer dereference that was causing [[ https://bugs.kde.org/show_bug.cgi?id=411634 | BUG 411634 ]]. This was introduced in {D22787} 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.

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: #libkgapi, kde-pim

Tags: #kde_pim, #libkgapi

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

M  +1    -2    src/drive/fileabstractuploadjob.cpp
M  +3    -1    src/drive/filemodifyjob.cpp

https://commits.kde.org/libkgapi/2cbbdda752270cb505465eb789938fbd0fa3ae51
Comment 2 Elvis Angelaccio 2019-10-20 10:35:20 UTC
*** Bug 412791 has been marked as a duplicate of this bug. ***