<table><tr><td style="">rthomsen created this revision.<br />rthomsen added a reviewer: elvisangelaccio.<br />rthomsen added a project: Ark.<br />Herald added subscribers: Ark, kde-utils-devel.<br />rthomsen requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29383">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This diff improves error-handling in <tt style="background: #ebebeb; font-size: 13px;">LibarchivePlugin::list()</tt>. Previously we only checked whether we could read until the end of the archive, and even if we couldn't there was no error shown to the user. The diff checks the return value of both <tt style="background: #ebebeb; font-size: 13px;">archive_read_next_header()</tt> and <tt style="background: #ebebeb; font-size: 13px;">archive_read_data_skip()</tt>, and shows a corrupt archive query if either was not successful.</p>

<p>This partially solves bug <a href="https://bugs.kde.org/show_bug.cgi?id=411074" class="remarkup-link" target="_blank" rel="noreferrer">411074</a>, as Ark now at least gives a warning when opening the archive. We still need to improve error-handling when extracting, but the code in <tt style="background: #ebebeb; font-size: 13px;">LibarchivePlugin::extractFiles()</tt> is such a mess currently so it's a larger task.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Open a corrupt archive using the libarchive plugin, e.g. the attached archive in bug <a href="https://bugs.kde.org/show_bug.cgi?id=411074" class="remarkup-link" target="_blank" rel="noreferrer">411074</a>, and verify that the corrupt archive warning is shown.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R36 Ark</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29383">https://phabricator.kde.org/D29383</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/libarchive/libarchiveplugin.cpp<br />
plugins/libarchive/libarchiveplugin.h</div></div></div><br /><div><strong>To: </strong>rthomsen, elvisangelaccio<br /><strong>Cc: </strong>kde-utils-devel, Ark, fbampaloukas, tctara<br /></div>