Bug 463674

Summary: NULL pointer access when clipboard content is NULL
Product: [Applications] konqueror Reporter: Christopher Yeleighton <giecrilj>
Component: generalAssignee: Konqueror Bugs <konqueror-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 22.12.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 291991    

Description Christopher Yeleighton 2022-12-31 21:01:12 UTC
SUMMARY
Konqueror crashes with a NULL pointer access when clipboard content is NULL

STEPS TO REPRODUCE
1. { konqueror --platform minimal; }
 
OBSERVED RESULT
KCrash: Application 'konqueror' crashing...
#6  0x00007ffff5d00df0 in QMimeData::hasText (this=0x0)
    at ../../include/QtCore/../../src/corelib/text/qstring.h:967
967         Q_DECL_CONSTEXPR inline QString(QStringDataPtr dd) : d(dd.ptr) {}
#7  0x00007ffff7f383f7 in KonqMainWindow::slotClipboardDataChanged (this=this@entry=0x5555555f0a80)
    at /usr/src/debug/konqueror-22.12.0/src/konqmainwindow.cpp:3118
3118        m_paPaste->setEnabled(data->hasText());

EXPECTED RESULT
The name org.kde.konqueror is owned by :1.299

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: openSUSE Tumbleweed 20221230
(available in About System)
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
Comment 1 Christopher Yeleighton 2022-12-31 21:45:47 UTC
The same crash occurs for { konqueror --platform vnc; } :-(
Comment 2 Christopher Yeleighton 2022-12-31 22:03:04 UTC
I was able to get a VNC session given export KDE_DEBUG=0.
Comment 3 Christopher Yeleighton 2022-12-31 22:04:21 UTC
But it immediately crashed after telling Konqueror to restore a crashed session.
Comment 4 Bug Janitor Service 2023-01-03 08:25:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/konqueror/-/merge_requests/162
Comment 5 Stefano Crocco 2023-01-26 16:20:59 UTC
Git commit c1975ad366ea63b28d62f57509fc74d7d88b58de by Stefano Crocco.
Committed on 26/01/2023 at 16:04.
Pushed by stefanocrocco into branch 'master'.

Avoid a crash when QClipboard::mimeData returns nullptr

M  +4    -2    src/konqmainwindow.cpp

https://invent.kde.org/network/konqueror/commit/c1975ad366ea63b28d62f57509fc74d7d88b58de
Comment 6 Stefano Crocco 2023-01-26 16:50:32 UTC
Git commit d628bbfcf618e9cd62c7789d592990014642e9c4 by Stefano Crocco.
Committed on 26/01/2023 at 16:50.
Pushed by stefanocrocco into branch 'release/22.12'.

Avoid a crash when QClipboard::mimeData returns nullptr


(cherry picked from commit c1975ad366ea63b28d62f57509fc74d7d88b58de)

M  +4    -2    src/konqmainwindow.cpp

https://invent.kde.org/network/konqueror/commit/d628bbfcf618e9cd62c7789d592990014642e9c4