Review Request 118450: Add null-pointer safety check to KonqOperations::pasteInfo(const KUrl&) (to fix a crash on Wayland)

Frank Reininghaus frank78ac at googlemail.com
Sun Jun 1 13:32:47 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118450/
-----------------------------------------------------------

Review request for KDE Base Apps and David Faure.


Bugs: 335053
    http://bugs.kde.org/show_bug.cgi?id=335053


Repository: kde-baseapps


Description
-------

According to a recent bug report, QApplication::clipboard()->mimeData() may return 0 on Wayland, which causes Dolphin to crash on startup (we check the clipboard contents on startup to determine the text of the "Paste" action).

While this is might be a bug in Qt's Wayland support itself (I could not do any tests myself because I have not worked with Wayland yet), we can at least try to work around the problem by checking the return value of that function before we dereference the pointer.

This patch is for master, even though master can probably not be used on Wayland at all, but I think that adding a null-pointer check already there and merging it to frameworks then does not hurt. If it is preferred to fix this in the frameworks branch only, this is also fine for me.


Diffs
-----

  lib/konq/konq_operations.cpp 781ea1e 

Diff: https://git.reviewboard.kde.org/r/118450/diff/


Testing
-------

Updating the text of the paste action still seems to work fine. I could not test if it fixes the crash, but I'm pretty sure that at least a crash with the reported backtrace will not happen any more.


Thanks,

Frank Reininghaus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140601/d53f43f1/attachment.htm>


More information about the kde-core-devel mailing list