diff options
author | Saturneric <[email protected]> | 2022-03-19 08:42:47 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-03-19 08:42:47 +0000 |
commit | f8a513cee895e656563ca90297b46f21e1e1edb3 (patch) | |
tree | b4d45b801a1a4a25c15db8e6d44dd77f5bf0e8de /src/core/function/ArchiveFileOperator.cpp | |
parent | Merge branch 'develop-2.0.5' of github.com:saturneric/GpgFrontend into develo... (diff) | |
download | GpgFrontend-f8a513cee895e656563ca90297b46f21e1e1edb3.tar.gz GpgFrontend-f8a513cee895e656563ca90297b46f21e1e1edb3.zip |
<fix>(core, ui): fix codacy issues.
1. The scope of the variable 'r' can be reduced.
2. Class 'IMAPFolder' does not have a copy constructor which is recommended since it has dynamic memory/resource allocation(s).
3. Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20).
Diffstat (limited to 'src/core/function/ArchiveFileOperator.cpp')
-rw-r--r-- | src/core/function/ArchiveFileOperator.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/function/ArchiveFileOperator.cpp b/src/core/function/ArchiveFileOperator.cpp index 1a1ffaec..17f29df1 100644 --- a/src/core/function/ArchiveFileOperator.cpp +++ b/src/core/function/ArchiveFileOperator.cpp @@ -231,11 +231,11 @@ void GpgFrontend::ArchiveFileOperator::ExtractArchive( LOG(ERROR) << "cannot read from stdin"; } #ifdef WINDOWS - if ((r = archive_read_open_filename_w(a, archive_path.wstring().c_str(), - 10240))) { + if (archive_read_open_filename_w(a, archive_path.wstring().c_str(), + 10240) != ARCHIVE_OK) { #else - if ((r = archive_read_open_filename(a, archive_path.u8string().c_str(), - 10240))) { + if (archive_read_open_filename(a, archive_path.u8string().c_str(), + 10240) != ARCHIVE_OK) { #endif LOG(ERROR) << "archive_read_open_filename() failed: " << archive_error_string(a); |