Check clipboard->mimeData() is valid
ClosedPublic

Authored by ansraliant on Sep 27 2018, 11:46 AM.

Details

Summary

BUG: 395666

Bug reported crashes on yakuake in a wayland session. Further
investigation revealed that other KDE product Kolourpaint experienced
nullptr on wayland while getting MimeData which was consistent with
the stacktrace provided by the author of the bug.

This diff validates the presence of MimeData before proceeding with
the drag action.

Test Plan
  1. Use wayland session
  2. Open Yakuake in fullscreen
  3. With a touch enabled laptop, scroll with many fingers (possibly 8)
  4. Yakuake should not crash

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ansraliant created this revision.Sep 27 2018, 11:46 AM
Restricted Application added a project: Konsole. · View Herald TranscriptSep 27 2018, 11:46 AM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
ansraliant requested review of this revision.Sep 27 2018, 11:46 AM

Please move BUG: 395666 to the summary section and change the title to something descriptive. See https://community.kde.org/Infrastructure/Phabricator#Formatting_your_patch

Small nip-tick, +1 for the patch.

src/TerminalDisplay.cpp
3915

Just make

if (!clipboardMimeData) {
    return;
}
ansraliant retitled this revision from BUG: 395666 to Validate possible nullptr while obtaining ClipboardMimeData.Sep 29 2018, 3:26 AM
ansraliant edited the summary of this revision. (Show Details)
ansraliant updated this revision to Diff 42533.Sep 29 2018, 3:36 AM

Thanks for the comments.

I changed the Title and the summary as requested by @ngraham and changed the if as requested by @anthonyfieroni

Thanks for that patch - I'll test it shortly although I don't think I have a laptop w/ wayland on it.

hindenburg added inline comments.Sep 30 2018, 5:20 PM
src/TerminalDisplay.cpp
3915

I try to not use implicit bool conversion so this should really be == nullptr

hindenburg retitled this revision from Validate possible nullptr while obtaining ClipboardMimeData to Check clipboard->mimeData() is valid.Sep 30 2018, 5:44 PM
hindenburg edited the summary of this revision. (Show Details)
hindenburg accepted this revision.Sep 30 2018, 5:48 PM

The note I added is not a show stopper - I'll fix that later.

This revision is now accepted and ready to land.Sep 30 2018, 5:48 PM
This revision was automatically updated to reflect the committed changes.