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/opendht-2.1.6/MSVC/unistd.h
Examining data/opendht-2.1.6/MSVC/wingetopt.c
Examining data/opendht-2.1.6/MSVC/wingetopt.h
Examining data/opendht-2.1.6/c/opendht.cpp
Examining data/opendht-2.1.6/c/opendht_c.h
Examining data/opendht-2.1.6/include/opendht.h
Examining data/opendht-2.1.6/include/opendht/callbacks.h
Examining data/opendht-2.1.6/include/opendht/crypto.h
Examining data/opendht-2.1.6/include/opendht/def.h
Examining data/opendht-2.1.6/include/opendht/default_types.h
Examining data/opendht-2.1.6/include/opendht/dht.h
Examining data/opendht-2.1.6/include/opendht/dht_interface.h
Examining data/opendht-2.1.6/include/opendht/dht_proxy_client.h
Examining data/opendht-2.1.6/include/opendht/dht_proxy_server.h
Examining data/opendht-2.1.6/include/opendht/dhtrunner.h
Examining data/opendht-2.1.6/include/opendht/http.h
Examining data/opendht-2.1.6/include/opendht/indexation/pht.h
Parsing failed to find end of parameter list; semicolon terminated it in (k.begin(), k.end(), keySpec_.begin(),
                [&](const Key::value_type& key, const KeySpec::value_type& key_spec) {
                    return key.first == key_spec.first and key.second.size
Examining data/opendht-2.1.6/include/opendht/infohash.h
Examining data/opendht-2.1.6/include/opendht/log.h
Examining data/opendht-2.1.6/include/opendht/log_enable.h
Examining data/opendht-2.1.6/include/opendht/network_engine.h
Examining data/opendht-2.1.6/include/opendht/network_utils.h
Examining data/opendht-2.1.6/include/opendht/node.h
Examining data/opendht-2.1.6/include/opendht/node_cache.h
Examining data/opendht-2.1.6/include/opendht/peer_discovery.h
Examining data/opendht-2.1.6/include/opendht/proxy.h
Examining data/opendht-2.1.6/include/opendht/rate_limiter.h
Examining data/opendht-2.1.6/include/opendht/rng.h
Examining data/opendht-2.1.6/include/opendht/routing_table.h
Examining data/opendht-2.1.6/include/opendht/scheduler.h
Examining data/opendht-2.1.6/include/opendht/securedht.h
Examining data/opendht-2.1.6/include/opendht/sockaddr.h
Examining data/opendht-2.1.6/include/opendht/thread_pool.h
Examining data/opendht-2.1.6/include/opendht/utils.h
Examining data/opendht-2.1.6/include/opendht/value.h
Examining data/opendht-2.1.6/src/base64.cpp
Examining data/opendht-2.1.6/src/base64.h
Examining data/opendht-2.1.6/src/callbacks.cpp
Examining data/opendht-2.1.6/src/crypto.cpp
Examining data/opendht-2.1.6/src/default_types.cpp
Examining data/opendht-2.1.6/src/dht.cpp
Examining data/opendht-2.1.6/src/dht_proxy_client.cpp
Examining data/opendht-2.1.6/src/dht_proxy_server.cpp
Examining data/opendht-2.1.6/src/dhtrunner.cpp
Examining data/opendht-2.1.6/src/http.cpp
Examining data/opendht-2.1.6/src/indexation/pht.cpp
Examining data/opendht-2.1.6/src/infohash.cpp
Examining data/opendht-2.1.6/src/listener.h
Examining data/opendht-2.1.6/src/log.cpp
Examining data/opendht-2.1.6/src/net.h
Examining data/opendht-2.1.6/src/network_engine.cpp
Examining data/opendht-2.1.6/src/network_utils.cpp
Examining data/opendht-2.1.6/src/node.cpp
Examining data/opendht-2.1.6/src/node_cache.cpp
Examining data/opendht-2.1.6/src/op_cache.cpp
Examining data/opendht-2.1.6/src/op_cache.h
Examining data/opendht-2.1.6/src/parsed_message.h
Examining data/opendht-2.1.6/src/peer_discovery.cpp
Examining data/opendht-2.1.6/src/request.h
Examining data/opendht-2.1.6/src/rng.cpp
Examining data/opendht-2.1.6/src/routing_table.cpp
Examining data/opendht-2.1.6/src/search.h
Examining data/opendht-2.1.6/src/securedht.cpp
Examining data/opendht-2.1.6/src/storage.h
Examining data/opendht-2.1.6/src/thread_pool.cpp
Examining data/opendht-2.1.6/src/utils.cpp
Examining data/opendht-2.1.6/src/value.cpp
Examining data/opendht-2.1.6/src/value_cache.h
Examining data/opendht-2.1.6/tests/cryptotester.cpp
Examining data/opendht-2.1.6/tests/cryptotester.h
Examining data/opendht-2.1.6/tests/dhtproxytester.cpp
Examining data/opendht-2.1.6/tests/dhtproxytester.h
Examining data/opendht-2.1.6/tests/dhtrunnertester.cpp
Examining data/opendht-2.1.6/tests/dhtrunnertester.h
Examining data/opendht-2.1.6/tests/httptester.cpp
Examining data/opendht-2.1.6/tests/httptester.h
Examining data/opendht-2.1.6/tests/infohashtester.cpp
Examining data/opendht-2.1.6/tests/infohashtester.h
Examining data/opendht-2.1.6/tests/peerdiscoverytester.cpp
Examining data/opendht-2.1.6/tests/peerdiscoverytester.h
Examining data/opendht-2.1.6/tests/tests_runner.cpp
Examining data/opendht-2.1.6/tests/threadpooltester.cpp
Examining data/opendht-2.1.6/tests/threadpooltester.h
Examining data/opendht-2.1.6/tests/valuetester.cpp
Examining data/opendht-2.1.6/tests/valuetester.h
Examining data/opendht-2.1.6/tools/dhtchat.cpp
Examining data/opendht-2.1.6/tools/dhtcnode.c
Examining data/opendht-2.1.6/tools/dhtnode.cpp
Examining data/opendht-2.1.6/tools/dhtscanner.cpp
Examining data/opendht-2.1.6/tools/durl.cpp
Examining data/opendht-2.1.6/tools/perftest.cpp
Examining data/opendht-2.1.6/tools/tools_common.h

FINAL RESULTS:

data/opendht-2.1.6/include/opendht/http.h:28:11:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#   undef snprintf
data/opendht-2.1.6/include/opendht/http.h:29:12:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#   define snprintf snprintf
data/opendht-2.1.6/include/opendht/http.h:29:21:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#   define snprintf snprintf
data/opendht-2.1.6/src/log.cpp:40:15:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    int ret = vsnprintf(buffer.data(), buffer.size(), m, args);
data/opendht-2.1.6/tools/tools_common.h:125:10:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
    bool syslog {false};
data/opendht-2.1.6/tools/tools_common.h:179:20:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
        if (params.syslog or (params.daemonize and params.logfile.empty()))
data/opendht-2.1.6/MSVC/unistd.h:46:9:  [3] (random) srandom:
  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.
#define srandom srand
data/opendht-2.1.6/MSVC/unistd.h:46:17:  [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.
#define srandom srand
data/opendht-2.1.6/MSVC/unistd.h:47:9:  [3] (random) random:
  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.
#define random rand
data/opendht-2.1.6/MSVC/wingetopt.c:114:48:  [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.
    d->__posixly_correct = posixly_correct | !!getenv("POSIXLY_CORRECT");
data/opendht-2.1.6/MSVC/wingetopt.h:85:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        #define getopt getopt_w
data/opendht-2.1.6/MSVC/wingetopt.h:86:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        #define getopt_long getopt_long_w
data/opendht-2.1.6/MSVC/wingetopt.h:91:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        #define getopt getopt_a
data/opendht-2.1.6/MSVC/wingetopt.h:92:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        #define getopt_long getopt_long_a
data/opendht-2.1.6/tools/durl.cpp:62:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, "hvVH", long_options, nullptr)) != -1) {
data/opendht-2.1.6/tools/tools_common.h:241:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, "hidsvDUPp:n:b:f:l:", long_options, nullptr)) != -1) {
data/opendht-2.1.6/c/opendht.cpp:419: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((struct sockaddr*)ret[i], addrs[i].get(), len);
data/opendht-2.1.6/include/opendht/node.h:96:14:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        std::memcpy(&ne.ss, addr.get(), ne.sslen);
data/opendht-2.1.6/include/opendht/sockaddr.h:295:18:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            std::memcpy((uint8_t*)get(), (const uint8_t*)sa, len);
data/opendht-2.1.6/include/opendht/utils.h:89: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 buf[16];
data/opendht-2.1.6/src/crypto.cpp:886: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 serial[64];
data/opendht-2.1.6/src/default_types.cpp:60: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.
        char hbuf[NI_MAXHOST];
data/opendht-2.1.6/src/http.cpp:200:25:  [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 subject_name[1024];
data/opendht-2.1.6/src/log.cpp:79: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).
    logfile->open(path, std::ios::out);
data/opendht-2.1.6/src/network_engine.cpp:856:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    std::memcpy(&sin.sin_addr, ni, 4);
data/opendht-2.1.6/src/network_engine.cpp:857:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    std::memcpy(&sin.sin_port, ni + 4, 2);
data/opendht-2.1.6/src/network_engine.cpp:864:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    std::memcpy(&sin6.sin6_addr, ni, 16);
data/opendht-2.1.6/src/network_engine.cpp:865:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    std::memcpy(&sin6.sin6_port, ni + 16, 2);
data/opendht-2.1.6/src/network_engine.cpp:1035: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(dest, n.id.data(), HASH_LEN);
data/opendht-2.1.6/src/network_engine.cpp:1036: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(dest + HASH_LEN, &sin.sin_addr, sizeof(in_addr));
data/opendht-2.1.6/src/network_engine.cpp:1037: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(dest + HASH_LEN + sizeof(in_addr), &sin.sin_port, sizeof(in_port_t));
data/opendht-2.1.6/src/network_engine.cpp:1045: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(dest, n.id.data(), HASH_LEN);
data/opendht-2.1.6/src/network_engine.cpp:1046: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(dest + HASH_LEN, &sin6.sin6_addr, sizeof(in6_addr));
data/opendht-2.1.6/src/network_engine.cpp:1047: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(dest + HASH_LEN + sizeof(in6_addr), &sin6.sin6_port, sizeof(in_port_t));
data/opendht-2.1.6/src/utils.cpp:107: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 hbuf[NI_MAXHOST];
data/opendht-2.1.6/src/utils.cpp:108: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 sbuf[NI_MAXSERV];
data/opendht-2.1.6/tools/dhtchat.cpp:38: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 buf[80];
data/opendht-2.1.6/tools/tools_common.h:244:32:  [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).
                int port_arg = atoi(optarg);
data/opendht-2.1.6/tools/tools_common.h:252:32:  [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).
                int port_arg = atoi(optarg);
data/opendht-2.1.6/tools/tools_common.h:260:32:  [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).
                int port_arg = atoi(optarg);
data/opendht-2.1.6/tools/tools_common.h:386: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 line_read[512];
data/opendht-2.1.6/MSVC/wingetopt.c:208:46:  [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 (namelen == (unsigned int)strlen(p->name))
data/opendht-2.1.6/MSVC/wingetopt.c:245:34:  [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).
                d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:271:42:  [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).
                        d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:286:42:  [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).
                        d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:291:34:  [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).
                d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:369:69:  [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 ((unsigned int) (nameend - d->__nextchar) == strlen(p->name))
data/opendht-2.1.6/MSVC/wingetopt.c:390:38:  [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).
                    d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:407:46:  [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).
                            d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:421:46:  [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).
                            d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:427:38:  [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).
                    d->__nextchar += strlen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:668:46:  [1] (buffer) wcslen:
  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 (namelen == (unsigned int)wcslen(p->name))
data/opendht-2.1.6/MSVC/wingetopt.c:705:34:  [1] (buffer) wcslen:
  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).
                d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:731:42:  [1] (buffer) wcslen:
  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).
                        d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:746:42:  [1] (buffer) wcslen:
  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).
                        d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:751:34:  [1] (buffer) wcslen:
  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).
                d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:829:69:  [1] (buffer) wcslen:
  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 ((unsigned int) (nameend - d->__nextchar) == wcslen(p->name))
data/opendht-2.1.6/MSVC/wingetopt.c:850:38:  [1] (buffer) wcslen:
  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).
                    d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:867:46:  [1] (buffer) wcslen:
  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).
                            d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:881:46:  [1] (buffer) wcslen:
  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).
                            d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/MSVC/wingetopt.c:887:38:  [1] (buffer) wcslen:
  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).
                    d->__nextchar += wcslen(d->__nextchar);
data/opendht-2.1.6/c/opendht.cpp:44:92:  [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).
    *reinterpret_cast<dht::InfoHash*>(h) = dht::InfoHash::get((const uint8_t*)dat, (size_t)strlen(dat));
data/opendht-2.1.6/include/opendht/indexation/pht.h:511:18:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
            std::equal(k.begin(), k.end(), keySpec_.begin(),
data/opendht-2.1.6/include/opendht/infohash.h:287:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    s.read(&(*dat.begin()), dat.size());
data/opendht-2.1.6/include/opendht/utils.h:179:35:  [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).
    return findMapValue(map, key, strlen(key));
data/opendht-2.1.6/src/crypto.cpp:150:18:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    if (not std::equal(digest.begin(), digest.end(), data.end() - GCM_DIGEST_SIZE)) {
data/opendht-2.1.6/src/crypto.cpp:161:22:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
        if (not std::equal(digest.begin(), digest.end(), data.end() - GCM_DIGEST_SIZE))
data/opendht-2.1.6/src/default_types.cpp:62:48:  [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).
            s << " addr " << std::string(hbuf, strlen(hbuf));
data/opendht-2.1.6/src/dht.cpp:2551:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            file.read (pac.buffer(), size);
data/opendht-2.1.6/src/dht_proxy_server.cpp:367:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (is.read(pac.buffer(), size)) {
data/opendht-2.1.6/src/http.cpp:1076:17:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
        && std::equal(needle.begin(), needle.end(), haystack.begin());
data/opendht-2.1.6/src/network_utils.cpp:27:40:  [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).
#define write(s, b, f) send(s, b, (int)strlen(b), 0)
data/opendht-2.1.6/src/utils.cpp:197:17:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    return std::equal(MAPPED_IPV4_PREFIX.begin(), MAPPED_IPV4_PREFIX.end(), addr6);
data/opendht-2.1.6/tools/dhtcnode.c:91:46:  [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).
    dht_value* val = dht_value_new(data_str, strlen(data_str));
data/opendht-2.1.6/tools/tools_common.h:112:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (!file.read((char*)buffer.data(), size))
data/opendht-2.1.6/tools/tools_common.h:445:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(0);

ANALYSIS SUMMARY:

Hits = 76
Lines analyzed = 31542 in approximately 0.86 seconds (36871 lines/second)
Physical Source Lines of Code (SLOC) = 23652
Hits@level = [0]  39 [1]  35 [2]  25 [3]  10 [4]   6 [5]   0
Hits@level+ = [0+] 115 [1+]  76 [2+]  41 [3+]  16 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 4.86217 [1+] 3.21326 [2+] 1.73347 [3+] 0.676476 [4+] 0.253678 [5+]   0
Dot directories skipped = 2 (--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.