diff options
authorMichael Pyne <[email protected]>2016-05-07 20:30:19 -0400
committerMichael Pyne <[email protected]>2016-05-07 20:43:30 -0400
commit5d10d4469a1945b1cb1c84c38ada3ca2eac939b4 (patch)
parent5dff013d4a3fdc473bc17d608c822a221aa75f01 (diff)
Make static analyzer happy about uninit variables.
Coverity complains about an index being unset (CID 1356740). While I'm pretty sure this is a false positive given the code path in question there's no performance reason not to set the index here. While I was at it, I also fixed a GCC warning about a separate "potentially uninitialized" variable. Again seems to be a false positive (unless an extract operation starts somehow already marked to abort) but fixing anyways. I chose ARCHIVE_RETRY to hint to *not* abort the operation if this does somehow make it into error path.
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/libarchive/libarchiveplugin.cpp b/plugins/libarchive/libarchiveplugin.cpp
index 4316939..56f9160 100644
--- a/plugins/libarchive/libarchiveplugin.cpp
+++ b/plugins/libarchive/libarchiveplugin.cpp
@@ -85,7 +85,7 @@ bool LibarchivePlugin::list()
m_extractedFilesSize = 0;
struct archive_entry *aentry;
- int result;
+ int result = ARCHIVE_RETRY;
bool firstEntry = true;
while (!m_abortOperation && (result = archive_read_next_header(, &aentry)) == ARCHIVE_OK) {
@@ -234,7 +234,7 @@ bool LibarchivePlugin::copyFiles(const QVariantList& files, const QString& desti
- int index;
+ int index = -1;
// Retry with renamed entry, fire an overwrite query again
// if the new entry also exists.