Commit 75278be8 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa
Browse files

Ignore entries called "/".

'/' is the path separator, so the entry will ultimately become an empty
QStringList and crash things.

BUG: 241967

svn path=/trunk/KDE/kdeutils/ark/; revision=1140184
parent 259aac33
......@@ -555,12 +555,13 @@ bool ArchiveModel::dropMimeData(const QMimeData * data, Qt::DropAction action, i
return true;
}
// For a rationale, see bug #194241
// For a rationale, see bugs #194241 and #241967
QString ArchiveModel::cleanFileName(const QString& fileName)
{
QString cleanName(fileName);
if (cleanName == ".") { // "." is present in ISO files
if ((cleanName == QLatin1String("/")) ||
(cleanName == QLatin1String("."))) { // "." is present in ISO files
cleanName.clear();
} else if (cleanName.startsWith(QLatin1String("./"))) {
cleanName.remove(0, 2);
......@@ -728,6 +729,7 @@ void ArchiveModel::newEntry(const ArchiveEntry& receivedEntry, InsertBehaviour b
ArchiveEntry entry = receivedEntry;
//#194241: Filenames such as "./file" should be displayed as "file"
//#241967: Entries called "/" should be ignored
QString entryFileName = cleanFileName(entry[FileName].toString());
if (entryFileName.isEmpty()) { // The entry contains only "." or "./"
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment