Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/kwallet-kf5-5.74.0/autotests/blowfishtest.cpp
Examining data/kwallet-kf5-5.74.0/tests/KWallet/kwallettest.cpp
Examining data/kwallet-kf5-5.74.0/tests/KWallet/kwallettest.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletmany.cpp
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwallettest.cpp
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletasync.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletsync.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletboth.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletpath.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwallettest.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletwizardtest.cpp
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletmany.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletcbc.h
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletasync.cpp
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletcbc.cpp
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletpath.cpp
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletsync.cpp
Examining data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletboth.cpp
Examining data/kwallet-kf5-5.74.0/examples/asynchronous_app/dialog.cpp
Examining data/kwallet-kf5-5.74.0/examples/asynchronous_app/dialog.h
Examining data/kwallet-kf5-5.74.0/examples/asynchronous_app/main.cpp
Examining data/kwallet-kf5-5.74.0/src/api/KWallet/kwallet.h
Examining data/kwallet-kf5-5.74.0/src/api/KWallet/kwallet.cpp
Examining data/kwallet-kf5-5.74.0/src/api/KWallet/kwallet_mac.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwallet-query/src/querydriver.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwallet-query/src/main.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwallet-query/src/querydriver.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/blowfish.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletentry.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/testbf.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/testsha.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/backendtest.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/blockcipher.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/blockcipher.cc
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.cc
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.master.cc
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/sha1.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletentry.cc
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/blowfishtables.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/sha1.cc
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/blowfish.cc
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kbetterthankdialog.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kbetterthankdialog.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/knewwalletdialog.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/knewwalletdialog.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletwizard.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/main.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletsessionstore.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletwizard.cpp
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletsessionstore.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/ktimeout.h
Examining data/kwallet-kf5-5.74.0/src/runtime/kwalletd/ktimeout.cpp

FINAL RESULTS:

data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:100:5:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srand(time(nullptr));
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/main.cpp:155:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv("PAM_KWALLET5_LOGIN")) {
data/kwallet-kf5-5.74.0/src/api/KWallet/kwallet.cpp:497:27:  [2] (misc) 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? (CWE-362).
            r = interface.open(name, (qlonglong)w, appid());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:49:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
typedef char Digest[16];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:80:21:  [2] (misc) 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? (CWE-362).
        if (devrand.open(QIODevice::ReadOnly)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:95:21:  [2] (misc) 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? (CWE-362).
        if (devrand.open(QIODevice::ReadOnly)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:122:25:  [2] (misc) 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? (CWE-362).
            if (devrand.open(QIODevice::ReadOnly)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:153:65:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
BackendPersistHandler *BackendPersistHandler::getPersistHandler(char magicBuf[12])
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:559:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[4096];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:591:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[4096];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.h:44:53:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static BackendPersistHandler *getPersistHandler(char magicBuf[KWMAGIC_LEN]);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/blowfish.cc:52:45:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            data = (data << 8) | ((unsigned char *)m_key)[j++];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/blowfish.cc:120:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(m_key, key, bitlength / 8);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.cc:94:28:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                *tb++ ^= ((char *)_register)[i];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.cc:100:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(_register, elemBlock, _len);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.cc:129:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(_next, block, _len);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.cc:137:28:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                tb[i] ^= ((char *)_register)[i];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.cc:175:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(_next, elemBlock, _len);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.cc:184:32:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    *tb++ ^= ((char *)_register)[i];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.master.cc:80:24:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            tb[i] ^= ((char *)_register)[i];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.master.cc:86:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(_register, block, len);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.master.cc:112:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(_next, block, _len);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/cbc.master.cc:120:28:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                tb[i] ^= ((char *)_register)[i];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:153:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(block1.data(), sha.hash(), shasz);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:165:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(block2.data(), sha.hash(), shasz);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:178:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(block3.data(), sha.hash(), shasz);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:191:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                    memcpy(block4.data(), sha.hash(), shasz);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:199:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(hash.data(),      block1.data(), 14);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:200:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(hash.data() + 14, block2.data(), 14);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:201:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(hash.data() + 28, block3.data(), 14);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:202:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(hash.data() + 42, block4.data(), 14);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:207:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(hash.data(),      block1.data(), 20);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:208:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(hash.data() + 20, block2.data(), 20);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:209:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(hash.data() + 40, block3.data(), 16);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:215:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(hash.data(),      block1.data(), 20);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:216:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(hash.data() + 20, block2.data(), 20);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:222:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(hash.data(), block1.data(), 20);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:278:14:  [2] (misc) 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? (CWE-362).
int Backend::open(const QByteArray &password, WId w)
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:289:14:  [2] (misc) 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? (CWE-362).
int Backend::open(const GpgME::Key &key)
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:325:22:  [2] (misc) 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? (CWE-362).
        if (!newfile.open(QIODevice::ReadWrite)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:337:13:  [2] (misc) 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? (CWE-362).
    if (!db.open(QIODevice::ReadOnly)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:341:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char magicBuf[KWMAGIC_LEN];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:388:19:  [2] (misc) 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? (CWE-362).
    if (!saltFile.open(QIODevice::WriteOnly)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:418:13:  [2] (misc) 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? (CWE-362).
    if (!sf.open(QIODevice::WriteOnly | QIODevice::Unbuffered)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:709:23:  [2] (misc) 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? (CWE-362).
        if (!saltFile.open(QIODevice::ReadOnly)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.h:69:9:  [2] (misc) 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? (CWE-362).
    int open(const QByteArray &password, WId w = 0);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.h:71:9:  [2] (misc) 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? (CWE-362).
    int open(const GpgME::Key &key);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/sha1.cc:100:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(x, _data, 64);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/sha1.h:57:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char _buf[64];
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/backendtest.cpp:27:13:  [2] (misc) 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? (CWE-362).
    rc = be.open(bpass);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/backendtest.cpp:35:13:  [2] (misc) 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? (CWE-362).
    rc = be.open(apass);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/backendtest.cpp:39:13:  [2] (misc) 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? (CWE-362).
    rc = be.open(bpass);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/testbf.cpp:15:59:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    printf("%d:  0x11 == %d and 0x44 == %d\n", ((unsigned char *)et)[0],
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/testsha.cpp:13:59:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    printf("%d:  0x11 == %d and 0x44 == %d\n", ((unsigned char *)et)[0],
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:315:15:  [2] (misc) 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? (CWE-362).
int KWalletD::open(const QString& wallet, qlonglong wId, const QString& appid)
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:577:29:  [2] (misc) 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? (CWE-362).
            int pwless = b->open(QByteArray(), w);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:664:41:  [2] (misc) 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? (CWE-362).
                            int rc = b->open(password.toUtf8());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:715:20:  [2] (misc) 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? (CWE-362).
                b->open(gpgKey);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:771:37:  [2] (misc) 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? (CWE-362).
                        int rc = b->open(password.toUtf8());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:1053:29:  [2] (misc) 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? (CWE-362).
                    rc = w->open(p.toUtf8());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:1839:8:  [2] (misc) 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? (CWE-362).
    b->open(QByteArray());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.cpp:1858:8:  [2] (misc) 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? (CWE-362).
    b->open(QByteArray());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/kwalletd.h:44:9:  [2] (misc) 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? (CWE-362).
    int open(const QString &wallet, qlonglong wId, const QString &appid);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/main.cpp:82:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[BSIZE] = {'\0'};
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/main.cpp:121:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        pipefd = atoi(argv[x]);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/main.cpp:125:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        socketfd = atoi(argv[x]);
data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletmany.cpp:37:37:  [2] (misc) 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? (CWE-362).
void KWalletMany::walletOpened(bool open)
data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletmany.cpp:39:38:  [2] (misc) 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? (CWE-362).
    _out << "Got async wallet: " << (open) << '\n';
data/kwallet-kf5-5.74.0/tests/kwalletd/kwalletmany.h:28:28:  [2] (misc) 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? (CWE-362).
    void walletOpened(bool open);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:81:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            int rc = devrand.read(randBlock.data(), randBlock.size());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:100:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                int rc2 = devrand.read(randBlock.data() + rc, randBlock.size());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:123:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                int rc = devrand.read(randBlock.data(), randBlock.size());
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:317:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
int BlowfishPersistHandler::read(Backend *wb, QFile &db, WId)
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:562:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((bytes = encryptedData.read(buffer, sizeof(buffer) / sizeof(buffer[0]))) > 0) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:578:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
int GpgPersistHandler::read(Backend *wb, QFile &sf, WId w)
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:593:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (bytes = sf.read(buffer, sizeof(buffer) / sizeof(buffer[0]))) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.cpp:623:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (bytes = decryptedData.read(buffer, sizeof(buffer) / sizeof(buffer[0]))) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.h:47:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    virtual int read(Backend *wb, QFile &sf, WId w) = 0;
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.h:57:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int read(Backend *wb, QFile &sf, WId w) override;
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/backendpersisthandler.h:70:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int read(Backend *wb, QFile &sf, WId w) override;
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:342:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    db.read(magicBuf, KWMAGIC_LEN);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:347:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    db.read(magicBuf, 4);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/kwalletbackend.cc:367:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int result = phandler->read(this, db, w);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/testsha.cpp:23:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    rc = sha1->process(data, strlen((char *)data));
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/backend/tests/testsha.cpp:25:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (rc != strlen((char *)data)) {
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/main.cpp:55:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        readBytes = read(pipefd, buf + totalRead, PBKDF2_SHA512_KEYSIZE - totalRead);
data/kwallet-kf5-5.74.0/src/runtime/kwalletd/main.cpp:88:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            chop = strlen(str) - 1;

ANALYSIS SUMMARY:

Hits = 87
Lines analyzed = 11377 in approximately 0.34 seconds (33428 lines/second)
Physical Source Lines of Code (SLOC) = 8410
Hits@level = [0]  39 [1]  18 [2]  67 [3]   2 [4]   0 [5]   0
Hits@level+ = [0+] 126 [1+]  87 [2+]  69 [3+]   2 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 14.9822 [1+] 10.3448 [2+] 8.20452 [3+] 0.237812 [4+]   0 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.