The following issues were found

src/test/fuzz/versionbits.cpp
1 issues
syntax error
Error

Line: 112

              
constexpr uint32_t MAX_START_TIME = 4102444800; // 2100-01-01

FUZZ_TARGET_INIT(versionbits, initialize)
{
    const CChainParams& params = *g_params;
    const int64_t interval = params.GetConsensus().nPowTargetSpacing;
    assert(interval > 1); // need to be able to halve it
    assert(interval < std::numeric_limits<int32_t>::max());

            

Reported by Cppcheck.

test/functional/p2p_nobloomfilter_messages.py
1 issues
Missing class docstring
Error

Line: 20 Column: 1

              from test_framework.util import assert_equal


class P2PNoBloomFilterMessages(BitcoinTestFramework):
    def set_test_params(self):
        self.setup_clean_chain = True
        self.num_nodes = 1
        self.extra_args = [["-peerbloomfilters=0"]]


            

Reported by Pylint.

src/test/fuzz/validation_load_mempool.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 35 Column: 37 CWE codes: 362

              
    CTxMemPool pool{};
    auto fuzzed_fopen = [&](const fs::path&, const char*) {
        return fuzzed_file_provider.open();
    };
    (void)LoadMempool(pool, g_setup->m_node.chainman->ActiveChainstate(), fuzzed_fopen);
    (void)DumpMempool(pool, fuzzed_fopen, true);
}

            

Reported by FlawFinder.

src/leveldb/db/filename_test.cc
1 issues
syntax error
Error

Line: 16

              
class FileNameTest {};

TEST(FileNameTest, Parse) {
  Slice db;
  FileType type;
  uint64_t number;

  // Successful parses

            

Reported by Cppcheck.

src/test/fuzz/tx_pool.cpp
1 issues
syntax error
Error

Line: 113

                  SetMockTime(time);
}

FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
{
    // Pick an arbitrary upper bound to limit the runtime and avoid timeouts on
    // inputs.
    int limit_max_ops{300};


            

Reported by Cppcheck.

src/qt/walletcontroller.h
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 144 Column: 10 CWE codes: 362

              public:
    OpenWalletActivity(WalletController* wallet_controller, QWidget* parent_widget);

    void open(const std::string& path);

Q_SIGNALS:
    void opened(WalletModel* wallet_model);

private:

            

Reported by FlawFinder.

src/qt/walletcontroller.cpp
1 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 345 Column: 26 CWE codes: 362

                  Q_EMIT finished();
}

void OpenWalletActivity::open(const std::string& path)
{
    QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path);

    showProgressDialog(tr("Opening Wallet <b>%1</b>…").arg(name.toHtmlEscaped()));


            

Reported by FlawFinder.

src/leveldb/db/dbformat_test.cc
1 issues
syntax error
Error

Line: 46

              
class FormatTest {};

TEST(FormatTest, InternalKey_EncodeDecode) {
  const char* keys[] = {"", "k", "hello", "longggggggggggggggggggggg"};
  const uint64_t seq[] = {1,
                          2,
                          3,
                          (1ull << 8) - 1,

            

Reported by Cppcheck.

src/leveldb/db/dbformat.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 215 Column: 3 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

                const char* start_;
  const char* kstart_;
  const char* end_;
  char space_[200];  // Avoid allocation for short keys
};

inline LookupKey::~LookupKey() {
  if (start_ != space_) delete[] start_;
}

            

Reported by FlawFinder.

src/leveldb/db/dbformat.cc
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 130 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                start_ = dst;
  dst = EncodeVarint32(dst, usize + 8);
  kstart_ = dst;
  memcpy(dst, user_key.data(), usize);
  dst += usize;
  EncodeFixed64(dst, PackSequenceAndType(s, kValueTypeForSeek));
  dst += 8;
  end_ = dst;
}

            

Reported by FlawFinder.