From 6c16a0938554a209c8b2a61dfd273e36880e9a03 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 1 Aug 2023 14:13:26 +0800 Subject: [PATCH 1/3] Guard against potential negative number --- src/gui/addnewtorrentdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index 88de009e9..947a91321 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -151,8 +151,8 @@ public: ? BitTorrent::TorrentContentLayout::NoSubfolder : BitTorrent::TorrentContentLayout::Subfolder); - if (!m_filePriorities.isEmpty()) - m_filePriorities.resize(filesCount(), BitTorrent::DownloadPriority::Normal); + if (const int fileCount = filesCount(); !m_filePriorities.isEmpty() && (fileCount >= 0)) + m_filePriorities.resize(fileCount, BitTorrent::DownloadPriority::Normal); } bool hasMetadata() const override From d554db4f4e2d4359bfbcbac452efee67d5236cdf Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 1 Aug 2023 14:19:18 +0800 Subject: [PATCH 2/3] Revise wording --- cmake/Modules/CommonConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/CommonConfig.cmake b/cmake/Modules/CommonConfig.cmake index 1db86d8a5..eb9806d72 100644 --- a/cmake/Modules/CommonConfig.cmake +++ b/cmake/Modules/CommonConfig.cmake @@ -12,7 +12,7 @@ set(CMAKE_AUTORCC_OPTIONS --compress 9 --threshold 5) add_library(qbt_common_cfg INTERFACE) -# Full C++ 20 support is required +# C++ 20 support is required # See also https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html # for a breakdown of the features that CMake recognizes for each C++ standard target_compile_features(qbt_common_cfg INTERFACE From 431860482c5a930868aa22484d60b11349fe1911 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 1 Aug 2023 14:23:51 +0800 Subject: [PATCH 3/3] GHA CI: specify a category for CodeQL analysis --- .github/workflows/ci_ubuntu.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci_ubuntu.yaml b/.github/workflows/ci_ubuntu.yaml index e19ea90e8..19bd0da25 100644 --- a/.github/workflows/ci_ubuntu.yaml +++ b/.github/workflows/ci_ubuntu.yaml @@ -94,6 +94,8 @@ jobs: - name: Run CodeQL analysis uses: github/codeql-action/analyze@v2 if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON') && startsWith(matrix.qt_version, 6) + with: + category: ${{ github.base_ref || github.ref_name }} - name: Prepare build artifacts run: |