From 90b1789d62efcb8d3e1948d58e2854733e31c63a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 21 Mar 2022 22:16:59 +0200 Subject: [PATCH] ark: crude crash fix for application/x-archive with weird directory entry e.g. the libkspeech.a static library created by cmake Signed-off-by: Ivailo Monev --- ark/plugins/libarchive/libarchivehandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ark/plugins/libarchive/libarchivehandler.cpp b/ark/plugins/libarchive/libarchivehandler.cpp index adf3cb95..a1baadbd 100644 --- a/ark/plugins/libarchive/libarchivehandler.cpp +++ b/ark/plugins/libarchive/libarchivehandler.cpp @@ -114,6 +114,11 @@ bool LibArchiveInterface::list() int result = ARCHIVE_EOF; while (!m_abortOperation && (result = archive_read_next_header(arch_reader.data(), &aentry)) == ARCHIVE_OK) { +#warning FIXME: fix double-slash root directory properly + if (qstrcmp(archive_entry_pathname(aentry), "//") == 0) { + archive_read_data_skip(arch_reader.data()); + continue; + } if (!m_emitNoEntries) { emitEntryFromArchiveEntry(aentry); }