Created attachment 144871 [details] Error dialog (window title is 'Error - Dolphin') SUMMARY kioslave crashes (instead of showing an error message) when I try to open a file (for which my user doesn't have read permission) in an sftp folder. STEPS TO REPRODUCE 1. ssh to a server 2. echo "test" > test.txt 3. chmod 000 test.txt 4. Open the corresponding folder in Dolphin via sftp and click on test.txt to open it OBSERVED RESULTS I get a message saying 'kioslave5 closed unexpectedly'. Dolphin displays an error window with just the address of the host I am connecting to (screenshot attached; the title of the dialog is 'Error - Dolphin'). EXPECTED RESULTS An error message telling the user that the file is not readable. SOFTWARE VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.23.4 KDE Frameworks Version: 5.89.0 Qt Version: 5.15.2 Kernel Version: 5.15.11-arch2-1 (64-bit) Graphics Platform: X11 ADDITIONAL INFORMATION (DEBUG TRACES) Application: kioslave5 (kioslave5), signal: Segmentation fault [KCrash Handler] #4 0x00007f47bc4e160e in sftp_close (file=0x0) at /usr/src/debug/libssh-0.9.6/src/sftp.c:1764 #5 0x00007f47c193c053 in operator() (__closure=<synthetic pointer>) at /usr/src/debug/kio-extras-21.12.0/sftp/kio_sftp.cpp:1268 #6 QScopeGuard<SFTPInternal::sftpGet(const QUrl&, KIO::fileoffset_t, int)::<lambda()> >::~QScopeGuard (this=<synthetic pointer>, __in_chrg=<optimized out>) at /usr/include/qt/QtCore/qscopeguard.h:80 #7 SFTPInternal::sftpGet (this=this@entry=0x55a641d4e950, url=..., offset=140724810787288, offset@entry=-1, fd=fd@entry=-1) at /usr/src/debug/kio-extras-21.12.0/sftp/kio_sftp.cpp:1340 #8 0x00007f47c193c4bd in SFTPInternal::get (this=0x55a641d4e950, url=...) at /usr/src/debug/kio-extras-21.12.0/sftp/kio_sftp.cpp:1206 #9 0x00007f47c193c65b in SFTPSlave::get (this=0x7ffd0c5bac90, url=...) at /usr/include/qt/QtCore/qscopedpointer.h:116 #10 0x00007f47c1812c7f in KIO::SlaveBase::dispatch (this=0x7ffd0c5bac90, command=67, data=...) at /usr/src/debug/kio-5.89.0/src/core/slavebase.cpp:1221 #11 0x00007f47c1813496 in KIO::SlaveBase::dispatchLoop (this=0x7ffd0c5bac90) at /usr/src/debug/kio-5.89.0/src/core/slavebase.cpp:335 #12 0x00007f47c193c818 in kdemain (argc=<optimized out>, argv=0x7ffd0c5bad80) at /usr/src/debug/kio-extras-21.12.0/sftp/kio_sftp.cpp:92 #13 0x000055a64111d20a in main (argc=5, argv=0x7ffd0c5baed8) at /usr/src/debug/kio-5.89.0/src/kioslave/kioslave.cpp:141 [Inferior 1 (process 57118) detached]
@Andreas, shouldn't sftp_close be safe to call with a nullptr?
*** Bug 451027 has been marked as a duplicate of this bug. ***
*** Bug 452025 has been marked as a duplicate of this bug. ***
Git commit ac49e5def4f6a22c868bd34e154cc980248c4419 by Harald Sitter. Committed on 06/04/2022 at 08:45. Pushed by ngraham into branch 'release/22.04'. sftp: guard sftp_close it's not safe to call with nullptrs M +4 -2 sftp/kio_sftp.cpp https://invent.kde.org/network/kio-extras/commit/ac49e5def4f6a22c868bd34e154cc980248c4419
*** Bug 453006 has been marked as a duplicate of this bug. ***