diff --git a/smb/kio_smb_browse.cpp b/smb/kio_smb_browse.cpp --- a/smb/kio_smb_browse.cpp +++ b/smb/kio_smb_browse.cpp @@ -492,6 +492,14 @@ { qCDebug(KIO_SMB) << url; + // Avoid crashing in smbc_fstatvfs below when + // requesting free space for smb:// which doesn't + // make sense to do to begin with + if (url.host().isEmpty()) { + error(KIO::ERR_COULD_NOT_STAT, url.url()); + return; + } + SMBUrl smbcUrl = url; int handle = smbc_opendir(smbcUrl.toSmbcUrl()); if (handle < 0) {