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/libtoxcore-0.2.12/auto_tests/TCP_test.c
Examining data/libtoxcore-0.2.12/auto_tests/bootstrap_test.c
Examining data/libtoxcore-0.2.12/auto_tests/check_compat.h
Examining data/libtoxcore-0.2.12/auto_tests/conference_av_test.c
Examining data/libtoxcore-0.2.12/auto_tests/conference_double_invite_test.c
Examining data/libtoxcore-0.2.12/auto_tests/conference_invite_merge_test.c
Examining data/libtoxcore-0.2.12/auto_tests/conference_peer_nick_test.c
Examining data/libtoxcore-0.2.12/auto_tests/conference_simple_test.c
Examining data/libtoxcore-0.2.12/auto_tests/conference_test.c
Examining data/libtoxcore-0.2.12/auto_tests/conference_two_test.c
Examining data/libtoxcore-0.2.12/auto_tests/crypto_test.c
Examining data/libtoxcore-0.2.12/auto_tests/dht_test.c
Examining data/libtoxcore-0.2.12/auto_tests/encryptsave_test.c
Examining data/libtoxcore-0.2.12/auto_tests/file_saving_test.c
Examining data/libtoxcore-0.2.12/auto_tests/file_transfer_test.c
Examining data/libtoxcore-0.2.12/auto_tests/friend_connection_test.c
Examining data/libtoxcore-0.2.12/auto_tests/friend_request_test.c
Examining data/libtoxcore-0.2.12/auto_tests/invalid_tcp_proxy_test.c
Examining data/libtoxcore-0.2.12/auto_tests/invalid_udp_proxy_test.c
Examining data/libtoxcore-0.2.12/auto_tests/lan_discovery_test.c
Examining data/libtoxcore-0.2.12/auto_tests/lossless_packet_test.c
Examining data/libtoxcore-0.2.12/auto_tests/lossy_packet_test.c
Examining data/libtoxcore-0.2.12/auto_tests/messenger_test.c
Examining data/libtoxcore-0.2.12/auto_tests/network_test.c
Examining data/libtoxcore-0.2.12/auto_tests/onion_test.c
Examining data/libtoxcore-0.2.12/auto_tests/overflow_recvq_test.c
Examining data/libtoxcore-0.2.12/auto_tests/overflow_sendq_test.c
Examining data/libtoxcore-0.2.12/auto_tests/reconnect_test.c
Examining data/libtoxcore-0.2.12/auto_tests/run_auto_test.h
Examining data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c
Examining data/libtoxcore-0.2.12/auto_tests/save_friend_test.c
Examining data/libtoxcore-0.2.12/auto_tests/save_load_test.c
Examining data/libtoxcore-0.2.12/auto_tests/send_message_test.c
Examining data/libtoxcore-0.2.12/auto_tests/set_name_test.c
Examining data/libtoxcore-0.2.12/auto_tests/set_status_message_test.c
Examining data/libtoxcore-0.2.12/auto_tests/skeleton_test.c
Examining data/libtoxcore-0.2.12/auto_tests/tcp_relay_test.c
Examining data/libtoxcore-0.2.12/auto_tests/tox_many_tcp_test.c
Examining data/libtoxcore-0.2.12/auto_tests/tox_many_test.c
Examining data/libtoxcore-0.2.12/auto_tests/tox_one_test.c
Examining data/libtoxcore-0.2.12/auto_tests/tox_strncasecmp_test.c
Examining data/libtoxcore-0.2.12/auto_tests/toxav_basic_test.c
Examining data/libtoxcore-0.2.12/auto_tests/toxav_many_test.c
Examining data/libtoxcore-0.2.12/auto_tests/typing_test.c
Examining data/libtoxcore-0.2.12/auto_tests/version_test.c
Examining data/libtoxcore-0.2.12/other/DHT_bootstrap.c
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/command_line_arguments.c
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/command_line_arguments.h
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.h
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config_defaults.h
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/global.h
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log.c
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log.h
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log_backend_stdout.c
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log_backend_stdout.h
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log_backend_syslog.c
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log_backend_syslog.h
Examining data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c
Examining data/libtoxcore-0.2.12/other/bootstrap_node_packets.c
Examining data/libtoxcore-0.2.12/other/bootstrap_node_packets.h
Examining data/libtoxcore-0.2.12/other/cpufeatures.c
Examining data/libtoxcore-0.2.12/other/fun/cracker.c
Examining data/libtoxcore-0.2.12/other/fun/minimal-save-generator.c
Examining data/libtoxcore-0.2.12/other/fun/save-generator.c
Examining data/libtoxcore-0.2.12/other/fun/sign.c
Examining data/libtoxcore-0.2.12/other/fun/strkey.c
Examining data/libtoxcore-0.2.12/super_donators/grencez_tok5.c
Examining data/libtoxcore-0.2.12/testing/DHT_test.c
Examining data/libtoxcore-0.2.12/testing/Messenger_test.c
Examining data/libtoxcore-0.2.12/testing/afl_toxsave.c
Examining data/libtoxcore-0.2.12/testing/misc_tools.c
Examining data/libtoxcore-0.2.12/testing/misc_tools.h
Examining data/libtoxcore-0.2.12/testing/random_testing.cc
Examining data/libtoxcore-0.2.12/testing/trace.cc
Examining data/libtoxcore-0.2.12/toxav/audio.c
Examining data/libtoxcore-0.2.12/toxav/audio.h
Examining data/libtoxcore-0.2.12/toxav/bwcontroller.c
Examining data/libtoxcore-0.2.12/toxav/bwcontroller.h
Examining data/libtoxcore-0.2.12/toxav/groupav.c
Examining data/libtoxcore-0.2.12/toxav/groupav.h
Examining data/libtoxcore-0.2.12/toxav/msi.c
Examining data/libtoxcore-0.2.12/toxav/msi.h
Examining data/libtoxcore-0.2.12/toxav/ring_buffer.c
Examining data/libtoxcore-0.2.12/toxav/ring_buffer.h
Examining data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc
Examining data/libtoxcore-0.2.12/toxav/rtp.c
Examining data/libtoxcore-0.2.12/toxav/rtp.h
Examining data/libtoxcore-0.2.12/toxav/rtp_test.cc
Examining data/libtoxcore-0.2.12/toxav/toxav.api.h
Examining data/libtoxcore-0.2.12/toxav/toxav.c
Examining data/libtoxcore-0.2.12/toxav/toxav.h
Examining data/libtoxcore-0.2.12/toxav/toxav_old.c
Examining data/libtoxcore-0.2.12/toxav/video.c
Examining data/libtoxcore-0.2.12/toxav/video.h
Examining data/libtoxcore-0.2.12/toxcore/DHT.c
Examining data/libtoxcore-0.2.12/toxcore/DHT.h
Examining data/libtoxcore-0.2.12/toxcore/LAN_discovery.api.h
Examining data/libtoxcore-0.2.12/toxcore/LAN_discovery.c
Examining data/libtoxcore-0.2.12/toxcore/LAN_discovery.h
Examining data/libtoxcore-0.2.12/toxcore/Messenger.c
Examining data/libtoxcore-0.2.12/toxcore/Messenger.h
Examining data/libtoxcore-0.2.12/toxcore/TCP_client.c
Examining data/libtoxcore-0.2.12/toxcore/TCP_client.h
Examining data/libtoxcore-0.2.12/toxcore/TCP_connection.c
Examining data/libtoxcore-0.2.12/toxcore/TCP_connection.h
Examining data/libtoxcore-0.2.12/toxcore/TCP_server.c
Examining data/libtoxcore-0.2.12/toxcore/TCP_server.h
Examining data/libtoxcore-0.2.12/toxcore/ccompat.h
Examining data/libtoxcore-0.2.12/toxcore/crypto_core.api.h
Examining data/libtoxcore-0.2.12/toxcore/crypto_core.c
Examining data/libtoxcore-0.2.12/toxcore/crypto_core.h
Examining data/libtoxcore-0.2.12/toxcore/crypto_core_mem.c
Examining data/libtoxcore-0.2.12/toxcore/crypto_core_test.cc
Examining data/libtoxcore-0.2.12/toxcore/friend_connection.c
Examining data/libtoxcore-0.2.12/toxcore/friend_connection.h
Examining data/libtoxcore-0.2.12/toxcore/friend_requests.c
Examining data/libtoxcore-0.2.12/toxcore/friend_requests.h
Examining data/libtoxcore-0.2.12/toxcore/group.c
Examining data/libtoxcore-0.2.12/toxcore/group.h
Examining data/libtoxcore-0.2.12/toxcore/list.c
Examining data/libtoxcore-0.2.12/toxcore/list.h
Examining data/libtoxcore-0.2.12/toxcore/logger.c
Examining data/libtoxcore-0.2.12/toxcore/logger.h
Examining data/libtoxcore-0.2.12/toxcore/mono_time.c
Examining data/libtoxcore-0.2.12/toxcore/mono_time.h
Examining data/libtoxcore-0.2.12/toxcore/mono_time_test.cc
Examining data/libtoxcore-0.2.12/toxcore/net_crypto.c
Examining data/libtoxcore-0.2.12/toxcore/net_crypto.h
Examining data/libtoxcore-0.2.12/toxcore/network.c
Examining data/libtoxcore-0.2.12/toxcore/network.h
Examining data/libtoxcore-0.2.12/toxcore/onion.c
Examining data/libtoxcore-0.2.12/toxcore/onion.h
Examining data/libtoxcore-0.2.12/toxcore/onion_announce.c
Examining data/libtoxcore-0.2.12/toxcore/onion_announce.h
Examining data/libtoxcore-0.2.12/toxcore/onion_client.c
Examining data/libtoxcore-0.2.12/toxcore/onion_client.h
Examining data/libtoxcore-0.2.12/toxcore/ping.api.h
Examining data/libtoxcore-0.2.12/toxcore/ping.c
Examining data/libtoxcore-0.2.12/toxcore/ping.h
Examining data/libtoxcore-0.2.12/toxcore/ping_array.api.h
Examining data/libtoxcore-0.2.12/toxcore/ping_array.c
Examining data/libtoxcore-0.2.12/toxcore/ping_array.h
Examining data/libtoxcore-0.2.12/toxcore/ping_array_test.cc
Examining data/libtoxcore-0.2.12/toxcore/state.c
Examining data/libtoxcore-0.2.12/toxcore/state.h
Examining data/libtoxcore-0.2.12/toxcore/tox.api.h
Examining data/libtoxcore-0.2.12/toxcore/tox.c
Examining data/libtoxcore-0.2.12/toxcore/tox.h
Examining data/libtoxcore-0.2.12/toxcore/tox_api.c
Examining data/libtoxcore-0.2.12/toxcore/tox_private.h
Examining data/libtoxcore-0.2.12/toxcore/util.c
Examining data/libtoxcore-0.2.12/toxcore/util.h
Examining data/libtoxcore-0.2.12/toxcore/util_test.cc
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt.h
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/export.h
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.h
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.c
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/runtime.h
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/scrypt_platform.c
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c
Examining data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/sysendian.h
Examining data/libtoxcore-0.2.12/toxencryptsave/defines.h
Examining data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.api.h
Examining data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c
Examining data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.h

FINAL RESULTS:

data/libtoxcore-0.2.12/testing/trace.cc:91:27:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    ssize_t const count = readlink("/proc/self/exe", result.data(), result.size());
data/libtoxcore-0.2.12/auto_tests/check_compat.h:54:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    fprintf(stderr, __VA_ARGS__);                                       \
data/libtoxcore-0.2.12/auto_tests/check_compat.h:62:3:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  fprintf(stderr, __VA_ARGS__);                                         \
data/libtoxcore-0.2.12/auto_tests/conference_test.c:269:13:  [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.
            snprintf(name, NAMELEN + 1, NEW_NAME_FORMAT_STR, state[i].index);
data/libtoxcore-0.2.12/auto_tests/conference_test.c:349:9:  [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.
        snprintf(name, NAMELEN + 1, NAME_FORMAT_STR, state[i].index);
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:144:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(base_path, srcdir);
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:146:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(base_path, argv[1]);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:171:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(*pid_file_path, tmp_pid_file);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:183:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(*keys_file_path, tmp_keys_file);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log_backend_stdout.c:30:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(log_backend_stdout_level(level), format, args);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log_backend_syslog.c:52:16:  [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 size = vsnprintf(nullptr, 0, format, args2);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/log_backend_syslog.c:62:5:  [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.
    vsnprintf(buf, size + 1, format, args);
data/libtoxcore-0.2.12/testing/trace.cc:106:18:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    Process pipe(popen(cmd.c_str(), "r"), pclose);
data/libtoxcore-0.2.12/toxcore/logger.c:117:5:  [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.
    vsnprintf(msg, sizeof(msg), format, args);
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:138:30:  [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.
        const char *srcdir = getenv("srcdir");
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/command_line_arguments.c:77: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, ":", long_options, nullptr)) != -1) {
data/libtoxcore-0.2.12/super_donators/grencez_tok5.c:13:3:  [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(getpid());
data/libtoxcore-0.2.12/toxcore/crypto_core.api.h:102:11:  [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.
namespace random {
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:89: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(handshake_plain + CRYPTO_PUBLIC_KEY_SIZE, f_nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:91: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(handshake, f_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:122: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(f_nonce_r, response_plain + CRYPTO_SHARED_KEY_SIZE, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:126: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(r_req_p + 1, f_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:132: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(r_req, &size, 2);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:156: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(&size, packet_resp, 2);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:204: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(handshake_plain + CRYPTO_PUBLIC_KEY_SIZE, sec_c->sent_nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:206: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(handshake, sec_c->public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:232: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(sec_c->recv_nonce, response_plain + CRYPTO_SHARED_KEY_SIZE, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:248: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(packet, &c_length, sizeof(uint16_t));
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:290: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(requ_p + 1, con3->public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:292: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(requ_p + 1, con1->public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:387: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(response_callback_public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/TCP_test.c:537: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(oob_pubkey, f2_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/conference_test.c:268:13:  [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 name[NAMELEN + 1];
data/libtoxcore-0.2.12/auto_tests/conference_test.c:348: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 name[NAMELEN + 1];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:25:23:  [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 const unsigned char alicesk[32] = {
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:32:23:  [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 const unsigned char bobpk[32] = {
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:39:23:  [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 const unsigned char test_nonce[24] = {
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:45:23:  [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 const unsigned char test_m[131] = {
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:65:23:  [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 const unsigned char test_c[147] = {
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:89: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 c[147];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:90: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 m[131];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:112: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 k[CRYPTO_SHARED_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:113: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 c[147];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:114: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 m[131];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:138: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 pk1[CRYPTO_PUBLIC_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:139: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 sk1[CRYPTO_SECRET_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:140: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 pk2[CRYPTO_PUBLIC_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:141: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 sk2[CRYPTO_SECRET_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:142: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 k1[CRYPTO_SHARED_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:143: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 k2[CRYPTO_SHARED_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:145: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 n[CRYPTO_NONCE_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:147: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 m[500];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:148: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 c1[sizeof(m) + CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:149: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 c2[sizeof(m) + CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:150: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 c3[sizeof(m) + CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:151: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 c4[sizeof(m) + CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:152: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 m1[sizeof(m)];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:153: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 m2[sizeof(m)];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:154: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 m3[sizeof(m)];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:155: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 m4[sizeof(m)];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:208: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 k[CRYPTO_SHARED_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:210: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 n[CRYPTO_NONCE_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:212: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 m1[MAX_CRYPTO_PACKET_SIZE - CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:213: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 c1[sizeof(m1) + CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:214: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 m1prime[sizeof(m1)];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:216: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 m2[MAX_CRYPTO_PACKET_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:217: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 c2[sizeof(m2) + CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:245: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 k[CRYPTO_SYMMETRIC_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:247: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 n[CRYPTO_NONCE_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:249: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 m1[16 * 16 * 16];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:250: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 c1[sizeof(m1) + CRYPTO_MAC_SIZE];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:251: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 m1prime[sizeof(m1)];
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:291: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(nonce + (CRYPTO_NONCE_SIZE - sizeof(num2)), &num2, sizeof(num2));
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:306: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(n1, n, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/auto_tests/crypto_test.c:326: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(src, test_c, sizeof(test_c));
data/libtoxcore-0.2.12/auto_tests/dht_test.c:431: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(cmp_list[i], pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/dht_test.c:443: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(p_b, cmp_list[i], CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/dht_test.c:444: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(cmp_list[i], pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/encryptsave_test.c:23:17:  [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 unsigned char test_salt[TOX_PASS_SALT_LENGTH] = {0xB1, 0xC2, 0x09, 0xEE, 0x50, 0x6C, 0xF0, 0x20, 0xC4, 0xD6, 0xEB, 0xC0, 0x44, 0x51, 0x3B, 0x60, 0x4B, 0x39, 0x4A, 0xCF, 0x09, 0x53, 0x4F, 0xEA, 0x08, 0x41, 0xFA, 0xCA, 0x66, 0xD2, 0x68, 0x7F};
data/libtoxcore-0.2.12/auto_tests/encryptsave_test.c:24:17:  [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 unsigned char known_key[TOX_PASS_KEY_LENGTH] = {0x29, 0x36, 0x1c, 0x9e, 0x65, 0xbb, 0x46, 0x8b, 0xde, 0xa1, 0xac, 0xf, 0xd5, 0x11, 0x81, 0xc8, 0x29, 0x28, 0x17, 0x23, 0xa6, 0xc3, 0x6b, 0x77, 0x2e, 0xd7, 0xd3, 0x10, 0xeb, 0xd2, 0xf7, 0xc8};
data/libtoxcore-0.2.12/auto_tests/encryptsave_test.c:28:17:  [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 unsigned char known_key2[CRYPTO_SHARED_KEY_SIZE] = {0x7a, 0xfa, 0x95, 0x45, 0x36, 0x8a, 0xa2, 0x5c, 0x40, 0xfd, 0xc0, 0xe2, 0x35, 0x8, 0x7, 0x88, 0xfa, 0xf9, 0x37, 0x86, 0xeb, 0xff, 0x50, 0x4f, 0x3, 0xe2, 0xf6, 0xd9, 0xef, 0x9, 0x17, 0x1};
data/libtoxcore-0.2.12/auto_tests/encryptsave_test.c:45: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 out[CRYPTO_SHARED_KEY_SIZE];
data/libtoxcore-0.2.12/auto_tests/encryptsave_test.c:105: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((uint8_t *)key, test_salt, TOX_PASS_SALT_LENGTH);
data/libtoxcore-0.2.12/auto_tests/encryptsave_test.c:106: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((uint8_t *)key + TOX_PASS_SALT_LENGTH, known_key2, TOX_PASS_KEY_LENGTH);
data/libtoxcore-0.2.12/auto_tests/file_saving_test.c:38:15:  [2] (misc) fopen:
  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).
    FILE *f = fopen(savefile, "w");
data/libtoxcore-0.2.12/auto_tests/file_saving_test.c:66:15:  [2] (misc) fopen:
  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).
    FILE *f = fopen(savefile, "r");
data/libtoxcore-0.2.12/auto_tests/messenger_test.c:218: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->friendlist[0].name, &test_name[0], 3);
data/libtoxcore-0.2.12/auto_tests/network_test.c:39: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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/auto_tests/network_test.c:154: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(&ip2.ip.v6, &ip6_loopback, sizeof(IP6));
data/libtoxcore-0.2.12/auto_tests/network_test.c:158: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(&ip1, &ip2, sizeof(IP));
data/libtoxcore-0.2.12/auto_tests/onion_test.c:115: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(test_3_ping_id, plain + 1, CRYPTO_SHA256_SIZE);
data/libtoxcore-0.2.12/auto_tests/onion_test.c:174: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(n1.public_key, dht_get_self_public_key(onion1->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/onion_test.c:179: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(n2.public_key, dht_get_self_public_key(onion2->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/onion_test.c:215: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(&s, sb_data, sizeof(uint64_t));
data/libtoxcore-0.2.12/auto_tests/onion_test.c:216: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(test_3_pub_key, nodes[3].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/onion_test.c:233: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(&s, sb_data, sizeof(uint64_t));
data/libtoxcore-0.2.12/auto_tests/onion_test.c:234: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(onion_announce_entry_public_key(onion2_a, 1), dht_get_self_public_key(onion2->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/onion_test.c:537: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(first_dht_pk, dht_get_self_public_key(onions[NUM_FIRST]->onion->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/onion_test.c:538: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(last_dht_pk, dht_get_self_public_key(onions[NUM_LAST]->onion->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:24:22:  [2] (misc) fopen:
  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).
    FILE *const fp = fopen(save_path, "r");
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:45:22:  [2] (misc) fopen:
  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).
    FILE *const fp = fopen(save_path, "r");
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:114: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 nospam_str[TOX_NOSPAM_SIZE * 2 + 1];
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:121: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 tox_id_str[TOX_ADDRESS_SIZE * 2 + 1] = {0};
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:135: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 base_path[4096];
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:150: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 save_path[4096 + sizeof(LOADED_SAVE_FILE)];
data/libtoxcore-0.2.12/auto_tests/save_friend_test.c:40: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(to_compare->name, name, length);
data/libtoxcore-0.2.12/auto_tests/save_friend_test.c:48: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(to_compare->status_message, message, length);
data/libtoxcore-0.2.12/other/DHT_bootstrap.c:46:23:  [2] (misc) fopen:
  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).
    FILE *keys_file = fopen("key", "r");
data/libtoxcore-0.2.12/other/DHT_bootstrap.c:62: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(keys, dht_get_self_public_key(dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/other/DHT_bootstrap.c:63: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(keys + CRYPTO_PUBLIC_KEY_SIZE, dht_get_self_secret_key(dht), CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/other/DHT_bootstrap.c:64:21:  [2] (misc) fopen:
  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).
        keys_file = fopen("key", "w");
data/libtoxcore-0.2.12/other/DHT_bootstrap.c:176:18:  [2] (misc) fopen:
  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).
    FILE *file = fopen(public_id_filename, "w");
data/libtoxcore-0.2.12/other/DHT_bootstrap.c:196:35:  [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).
        uint16_t port = net_htons(atoi(argv[argvoffset + 2]));
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:59:17:  [2] (misc) fopen:
  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).
    keys_file = fopen(keys_file_path, "r");
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:73: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(keys, dht_get_self_public_key(dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:74: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(keys + CRYPTO_PUBLIC_KEY_SIZE, dht_get_self_secret_key(dht), CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:76:21:  [2] (misc) fopen:
  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).
        keys_file = fopen(keys_file_path, "w");
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:99: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[2 * CRYPTO_PUBLIC_KEY_SIZE + 1];
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:105:18:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        index += sprintf(buffer + index, "%02X", public_key[i]);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:119:21:  [2] (misc) fopen:
  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 ((pid_file = fopen(pid_file_path, "r"))) {
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:125:16:  [2] (misc) fopen:
  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).
    pid_file = fopen(pid_file_path, "a+");
data/libtoxcore-0.2.12/other/bootstrap_node_packets.c:34: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(data + 1, &bootstrap_version, sizeof(bootstrap_version));
data/libtoxcore-0.2.12/other/bootstrap_node_packets.c:36: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(data + 1 + sizeof(bootstrap_version), bootstrap_motd, bootstrap_motd_length);
data/libtoxcore-0.2.12/other/bootstrap_node_packets.c:52: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(bootstrap_motd, motd, motd_length);
data/libtoxcore-0.2.12/other/fun/cracker.c:50: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(c_key, key, len);
data/libtoxcore-0.2.12/other/fun/minimal-save-generator.c:21: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 public_key[crypto_box_PUBLICKEYBYTES];
data/libtoxcore-0.2.12/other/fun/minimal-save-generator.c:22: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 secret_key[crypto_box_SECRETKEYBYTES];
data/libtoxcore-0.2.12/other/fun/minimal-save-generator.c:32: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 public_key_str[crypto_box_PUBLICKEYBYTES * 2 + 1];
data/libtoxcore-0.2.12/other/fun/minimal-save-generator.c:33: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 secret_key_str[crypto_box_SECRETKEYBYTES * 2 + 1];
data/libtoxcore-0.2.12/other/fun/minimal-save-generator.c:46: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 checksum[2] = {0};
data/libtoxcore-0.2.12/other/fun/minimal-save-generator.c:52: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 checksum_str[sizeof(checksum) * 2 + 1];
data/libtoxcore-0.2.12/other/fun/save-generator.c:19:16:  [2] (misc) fopen:
  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).
    FILE *fp = fopen(GENERATED_SAVE_FILE, "w");
data/libtoxcore-0.2.12/other/fun/save-generator.c:66: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 tox_id_str[TOX_ADDRESS_SIZE * 2];
data/libtoxcore-0.2.12/other/fun/save-generator.c:70: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 nospam_str[(TOX_NOSPAM_SIZE * 2) + 1];
data/libtoxcore-0.2.12/other/fun/sign.c:27:15:  [2] (misc) fopen:
  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).
    FILE *f = fopen(filename, "rb");
data/libtoxcore-0.2.12/other/fun/sign.c:52: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 pk[crypto_sign_ed25519_PUBLICKEYBYTES];
data/libtoxcore-0.2.12/other/fun/sign.c:53: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 sk[crypto_sign_ed25519_SECRETKEYBYTES];
data/libtoxcore-0.2.12/other/fun/sign.c:91:19:  [2] (misc) fopen:
  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).
        FILE *f = fopen(argv[4], "wb");
data/libtoxcore-0.2.12/other/fun/sign.c:97: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(sm + smlen, sm, crypto_sign_ed25519_BYTES); // Move signature from beginning to end of file.
data/libtoxcore-0.2.12/other/fun/sign.c:117: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(signe, data + size - crypto_sign_ed25519_BYTES,
data/libtoxcore-0.2.12/other/fun/sign.c:119: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(signe + crypto_sign_ed25519_BYTES, data, size - crypto_sign_ed25519_BYTES);
data/libtoxcore-0.2.12/other/fun/strkey.c:61: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 public_key[crypto_box_PUBLICKEYBYTES]; // null terminator
data/libtoxcore-0.2.12/other/fun/strkey.c:62: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 secret_key[crypto_box_SECRETKEYBYTES];
data/libtoxcore-0.2.12/other/fun/strkey.c:65: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 desired_bin[crypto_box_PUBLICKEYBYTES]; // null terminator
data/libtoxcore-0.2.12/other/fun/strkey.c:68: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).
        offset = atoi(argv[1]);
data/libtoxcore-0.2.12/testing/DHT_test.c:67: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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/testing/DHT_test.c:117: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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/testing/DHT_test.c:192: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 temp_id[128];
data/libtoxcore-0.2.12/testing/DHT_test.c:209:31:  [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).
    uint16_t port = net_htons(atoi(argv[argvoffset + 2]));
data/libtoxcore-0.2.12/testing/Messenger_test.c:110:35:  [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).
        uint16_t port = net_htons(atoi(argv[argvoffset + 2]));
data/libtoxcore-0.2.12/testing/Messenger_test.c:140: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 temp_hex_id[128];
data/libtoxcore-0.2.12/testing/Messenger_test.c:168:22:  [2] (misc) fopen:
  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).
        FILE *file = fopen(filename, "wb");
data/libtoxcore-0.2.12/testing/afl_toxsave.c:13:21:  [2] (misc) fopen:
  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).
    FILE *fileptr = fopen(argv[1], "rb");
data/libtoxcore-0.2.12/testing/trace.cc:99:28:  [2] (misc) fopen:
  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).
  File const log_file{std::fopen("trace.log", "w"), std::fclose};
data/libtoxcore-0.2.12/toxav/audio.c:162: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(&ac->lp_sampling_rate, msg->data, 4);
data/libtoxcore-0.2.12/toxav/groupav.c:407: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(pk->data, packet + sizeof(uint16_t), pk->length);
data/libtoxcore-0.2.12/toxav/groupav.c:569: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(ptr, packet, length);
data/libtoxcore-0.2.12/toxav/msi.c:410: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(dest, value, value_len);
data/libtoxcore-0.2.12/toxav/rtp.c:59: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(msg->data, data, msg->len);
data/libtoxcore-0.2.12/toxav/rtp.c:301: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(
data/libtoxcore-0.2.12/toxav/rtp.c:540: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(session->mp->data + header.offset_lower, data + RTP_HEADER_SIZE,
data/libtoxcore-0.2.12/toxav/rtp.c:806: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(rdata + 1 + RTP_HEADER_SIZE, data, length);
data/libtoxcore-0.2.12/toxav/rtp.c:824: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(rdata + 1 + RTP_HEADER_SIZE, data + sent, piece);
data/libtoxcore-0.2.12/toxav/rtp.c:844: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(rdata + 1 + RTP_HEADER_SIZE, data + sent, piece);
data/libtoxcore-0.2.12/toxav/toxav.c:768: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(dest, &sampling_rate, sizeof(sampling_rate));
data/libtoxcore-0.2.12/toxav/toxav.c:910: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(img.planes[VPX_PLANE_Y], y, width * height);
data/libtoxcore-0.2.12/toxav/toxav.c:911: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(img.planes[VPX_PLANE_U], u, (width / 2) * (height / 2));
data/libtoxcore-0.2.12/toxav/toxav.c:912: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(img.planes[VPX_PLANE_V], v, (width / 2) * (height / 2));
data/libtoxcore-0.2.12/toxav/video.c:446: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(vc->encoder, &new_c, sizeof(new_c));
data/libtoxcore-0.2.12/toxcore/DHT.c:136: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(dht->self_public_key, key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:140: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(dht->self_secret_key, key, CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:249: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(shared_key, key->shared_key, CRYPTO_SHARED_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:276: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(key->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:277: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(key->shared_key, shared_key, CRYPTO_SHARED_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:324: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(temp + 1, data, length);
data/libtoxcore-0.2.12/toxcore/DHT.c:335: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(packet + 1, recv_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:336: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(packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, send_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:363: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(public_key, packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:376: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(data, temp + 1, len1);
data/libtoxcore-0.2.12/toxcore/DHT.c:440: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(data + 1, &ip_port->ip.ip.v4, SIZE_IP4);
data/libtoxcore-0.2.12/toxcore/DHT.c:441: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(data + 1 + SIZE_IP4, &ip_port->port, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/DHT.c:451: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(data + 1, &ip_port->ip.ip.v6, SIZE_IP6);
data/libtoxcore-0.2.12/toxcore/DHT.c:452: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(data + 1 + SIZE_IP6, &ip_port->port, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/DHT.c:472: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(packet + 1, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:473: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(packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:474: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(packet + 1 + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_NONCE_SIZE, encrypted, encrypted_length);
data/libtoxcore-0.2.12/toxcore/DHT.c:525: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(&ip_port->ip.ip.v4, data + 1, SIZE_IP4);
data/libtoxcore-0.2.12/toxcore/DHT.c:526: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(&ip_port->port, data + 1 + SIZE_IP4, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/DHT.c:536: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(&ip_port->ip.ip.v6, data + 1, SIZE_IP6);
data/libtoxcore-0.2.12/toxcore/DHT.c:537: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(&ip_port->port, data + 1 + SIZE_IP6, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/DHT.c:564: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(data + packed_length, nodes[i].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:601: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(nodes[num].public_key, data + len_processed, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:683: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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/toxcore/DHT.c:743: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(list[index].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:758: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(pk_bak, nodes_list[i].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:760: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(nodes_list[i].public_key, pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:836: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(nodes_list[num_nodes].public_key, client->public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:903: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(&cmp1, a, sizeof(DHT_Cmp_data));
data/libtoxcore-0.2.12/toxcore/DHT.c:904: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(&cmp2, b, sizeof(DHT_Cmp_data));
data/libtoxcore-0.2.12/toxcore/DHT.c:1136: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(dht->to_bootstrap[*num].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:1167: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(format->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:1307: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(receiver.public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:1309: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(plain_message, &receiver, sizeof(receiver));
data/libtoxcore-0.2.12/toxcore/DHT.c:1314: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(plain_message + sizeof(receiver), sendback_node, sizeof(Node_format));
data/libtoxcore-0.2.12/toxcore/DHT.c:1327: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(plain, client_id, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:1328: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(plain + CRYPTO_PUBLIC_KEY_SIZE, &ping_id, sizeof(ping_id));
data/libtoxcore-0.2.12/toxcore/DHT.c:1375: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(plain + 1 + nodes_length, sendback_data, length);
data/libtoxcore-0.2.12/toxcore/DHT.c:1437: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(sendback_node, data + sizeof(Node_format), sizeof(Node_format));
data/libtoxcore-0.2.12/toxcore/DHT.c:1443: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(&test, data, sizeof(Node_format));
data/libtoxcore-0.2.12/toxcore/DHT.c:1590: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(dht_friend->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:1633: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(&dht->friends_list[friend_num],
data/libtoxcore-0.2.12/toxcore/DHT.c:1929: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(ip_portlist, ipv6s, num_ipv6s * sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/DHT.c:1941: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(&ip_portlist[num_ipv6s], ipv4s, num_ipv4s_used * sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/DHT.c:1950: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(ip_portlist, ipv6s, num_ipv6s * sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/DHT.c:1954: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(ip_portlist, ipv4s, num_ipv4s * sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/DHT.c:2069: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(data + 1, &ping_id, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/DHT.c:2102: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(&ping_id, packet + 1, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/DHT.c:2309: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(data + 1, contents, length);
data/libtoxcore-0.2.12/toxcore/DHT.c:2325: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(data, node_totest, sizeof(Node_format));
data/libtoxcore-0.2.12/toxcore/DHT.c:2326: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(data + sizeof(Node_format), search_id, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2342: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(data + 1, queried_client_id, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2343: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(data + 1 + CRYPTO_PUBLIC_KEY_SIZE, nodes_data, nodes_data_length);
data/libtoxcore-0.2.12/toxcore/DHT.c:2422: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(node.public_key, source_pubkey, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2423: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(&tocheck_node, packet + 1, sizeof(Node_format));
data/libtoxcore-0.2.12/toxcore/DHT.c:2492: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(id + i * sizeof(t), &t, sizeof(t));
data/libtoxcore-0.2.12/toxcore/DHT.c:2536: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(nodes[count].public_key, list[i - 1].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2617: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(to_test.public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2621: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(cur_iptspng->hardening.send_nodes_pingedid, rand_node.public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2830: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(clients, dht->loaded_nodes_list, sizeof(Node_format) * dht->loaded_num_nodes);
data/libtoxcore-0.2.12/toxcore/DHT.c:2836: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(clients[num].public_key, dht->close_clientlist[i].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2842: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(clients[num].public_key, dht->close_clientlist[i].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2853: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(clients[num].public_key, fr->client_list[j].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/DHT.c:2859: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(clients[num].public_key, fr->client_list[j].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/LAN_discovery.c:353: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 ip_str[IP_NTOA_LEN] = { 0 };
data/libtoxcore-0.2.12/toxcore/Messenger.c:93: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(real_pk, m->friendlist[friendnumber].real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/Messenger.c:134: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(address + CRYPTO_PUBLIC_KEY_SIZE, &nospam, sizeof(nospam));
data/libtoxcore-0.2.12/toxcore/Messenger.c:136: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(address + CRYPTO_PUBLIC_KEY_SIZE + sizeof(nospam), &checksum, sizeof(checksum));
data/libtoxcore-0.2.12/toxcore/Messenger.c:282: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->friendlist[ret].info, data, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:284: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->friendlist[ret].friendrequest_nospam, address + CRYPTO_PUBLIC_KEY_SIZE, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/Messenger.c:513: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(packet + 1, message, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:564: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->friendlist[friendnumber].name, name, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:587: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(m->name, name, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:611: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(name, m->name, m->name_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:628: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(name, m->friendlist[friendnumber].name, m->friendlist[friendnumber].name_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:657: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(m->statusmessage, status, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:716: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(buf, m->friendlist[friendnumber].statusmessage, msglen);
data/libtoxcore-0.2.12/toxcore/Messenger.c:731: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(buf, m->statusmessage, m->statusmessage_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:820: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(m->friendlist[friendnumber].statusmessage, status, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:971: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(packet + 1, data, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:1077: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(file_id, ft->id, FILE_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/Messenger.c:1100: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(packet + 1, &file_type, sizeof(file_type));
data/libtoxcore-0.2.12/toxcore/Messenger.c:1102: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(packet + 1 + sizeof(file_type) + sizeof(filesize), file_id, FILE_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/Messenger.c:1105: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(packet + 1 + sizeof(file_type) + sizeof(filesize) + FILE_ID_LENGTH, filename, filename_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:1161: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(ft->id, file_id, FILE_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/Messenger.c:1182: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(packet + 3, data, data_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:1368: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(packet + 2, data, length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2172: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(data_terminated, data, data_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2180: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(m->friendlist[i].name, data_terminated, data_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2193: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(data_terminated, data, data_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2250: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(message_terminated, message, message_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2312: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(ft->id, data + 1 + sizeof(uint32_t) + sizeof(uint64_t), FILE_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2319: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(filename_terminated, data + head_length, filename_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2534:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(&id_str[i * 2], "%02X", pk[i]);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2618:21:  [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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/toxcore/Messenger.c:2619:21:  [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 id_str[IDSTRING_LEN];
data/libtoxcore-0.2.12/toxcore/Messenger.c:2675:17:  [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 id_str[IDSTRING_LEN];
data/libtoxcore-0.2.12/toxcore/Messenger.c:2680:17:  [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 id_str[IDSTRING_LEN];
data/libtoxcore-0.2.12/toxcore/Messenger.c:2699: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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/toxcore/Messenger.c:2700: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 id_str[IDSTRING_LEN];
data/libtoxcore-0.2.12/toxcore/Messenger.c:2764: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(data, &temp->name, sizeof(temp->name));  \
data/libtoxcore-0.2.12/toxcore/Messenger.c:2769: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(data, temp->name, sizeof(temp->name));   \
data/libtoxcore-0.2.12/toxcore/Messenger.c:2982: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(temp.real_pk, m->friendlist[i].real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2989: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(temp.info, m->friendlist[i].info, friendrequest_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2995: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(temp.name, m->friendlist[i].name, m->friendlist[i].name_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:2997: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(temp.statusmessage, m->friendlist[i].statusmessage, m->friendlist[i].statusmessage_length);
data/libtoxcore-0.2.12/toxcore/Messenger.c:3054: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(address + CRYPTO_PUBLIC_KEY_SIZE, &temp.friendrequest_nospam, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/Messenger.c:3056: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(address + CRYPTO_PUBLIC_KEY_SIZE + sizeof(uint32_t), &checksum, sizeof(checksum));
data/libtoxcore-0.2.12/toxcore/Messenger.c:3074: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(data, m->name, len);
data/libtoxcore-0.2.12/toxcore/Messenger.c:3098: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(data, m->statusmessage, len);
data/libtoxcore-0.2.12/toxcore/Messenger.c:3149: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(relays, m->loaded_relays, sizeof(Node_format) * m->num_loaded_relays);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:130: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 ip[TOX_INET6_ADDRSTRLEN];
data/libtoxcore-0.2.12/toxcore/TCP_client.c: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(tcp_conn->last_packet + length, tcp_conn->ip_port.ip.ip.v4.uint8, sizeof(IP4));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:227: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(tcp_conn->last_packet + length, tcp_conn->ip_port.ip.ip.v6.uint8, sizeof(IP6));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:231: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(tcp_conn->last_packet + length, &tcp_conn->ip_port.port, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:279: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(plain + CRYPTO_PUBLIC_KEY_SIZE, tcp_conn->sent_nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:280: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(tcp_conn->last_packet, tcp_conn->self_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:309: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(tcp_conn->recv_nonce, plain + CRYPTO_PUBLIC_KEY_SIZE, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:395: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(new_list->data, packet, size);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:431: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(packet, &c_length, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:466: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(con->last_packet, packet, SIZEOF_VLA(packet));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:480: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(packet + 1, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:519: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(packet + 1, data, length);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:535: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(packet + 1, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:536: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(packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, data, length);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:598: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(packet + 1, &con->ping_request_id, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:620: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(packet + 1, &con->ping_response_id, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:653: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(packet + 1, data, length);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:713: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(temp->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:714: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(temp->self_public_key, self_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:774: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(conn->connections[con_id].public_key, data + 2, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_client.c:843: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(&ping_id, data + 1, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/TCP_client.c:855: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(&ping_id, data + 1, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/TCP_connection.c:522: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(con_to->public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_connection.c:781: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(relay_pk, tcp_con_public_key(tcp_con->connection), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_connection.c:832: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(tcp_con->relay_pk, tcp_con_public_key(tcp_con->connection), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_connection.c:1285: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(tcp_relays[copied].public_key, tcp_con_public_key(tcp_con->connection), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_connection.c:1394: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(temp->self_secret_key, secret_key, CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:161: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(con_new, con_old, sizeof(TCP_Secure_Connection));
data/libtoxcore-0.2.12/toxcore/TCP_server.c:451: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(new_list->data, packet, size);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:487: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(packet, &c_length, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/TCP_server.c:522: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(con->last_packet, packet, SIZEOF_VLA(packet));
data/libtoxcore-0.2.12/toxcore/TCP_server.c:589: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(con->public_key, data, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:594: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(resp_plain + CRYPTO_PUBLIC_KEY_SIZE, con->sent_nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:595: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(con->recv_nonce, plain + CRYPTO_PUBLIC_KEY_SIZE, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:641: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(data + 2, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:717: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(con->connections[index].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:765: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(resp_packet + 1, con->public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:766: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(resp_packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, data, length);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:827: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(packet + 1, data, length);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:880: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(response + 1, data + 1, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/TCP_server.c:891: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(&ping_id, data + 1, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/TCP_server.c:958: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(new_data, data, length);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:1130: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(temp->secret_key, secret_key, CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/TCP_server.c:1282: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(ping + 1, &ping_id, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/crypto_core.c:159: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(temp_plain + crypto_box_ZEROBYTES, plain, length);
data/libtoxcore-0.2.12/toxcore/crypto_core.c:169: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(encrypted, temp_encrypted + crypto_box_BOXZEROBYTES, length + crypto_box_MACBYTES);
data/libtoxcore-0.2.12/toxcore/crypto_core.c:198: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(temp_encrypted + crypto_box_BOXZEROBYTES, encrypted, length);
data/libtoxcore-0.2.12/toxcore/crypto_core.c:207: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(plain, temp_plain + crypto_box_ZEROBYTES, length - crypto_box_MACBYTES);
data/libtoxcore-0.2.12/toxcore/friend_connection.c:234: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(friend_con->tcp_relays[index].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/friend_connection.c:359: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(friend_con->dht_temp_pk, dht_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/friend_connection.c:660: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(real_pk, friend_con->real_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/friend_connection.c:664: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(dht_temp_pk, friend_con->dht_temp_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/friend_connection.c:763: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(friend_con->real_public_key, real_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/friend_connection.c:832: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(packet + 1, &nospam_num, sizeof(nospam_num));
data/libtoxcore-0.2.12/toxcore/friend_connection.c:833: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(packet + 1 + sizeof(nospam_num), data, length);
data/libtoxcore-0.2.12/toxcore/friend_requests.c:148: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(message, packet + sizeof(fr->nospam), message_len);
data/libtoxcore-0.2.12/toxcore/group.c:316: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(old_real_pk, g->closest_peers[index].real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:317: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(old_temp_pk, g->closest_peers[index].temp_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:322: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(g->closest_peers[index].real_pk, real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:323: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(g->closest_peers[index].temp_pk, temp_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:864: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(g->group[peer_index].nick, nick, nick_len);
data/libtoxcore-0.2.12/toxcore/group.c:898: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(g->title, title, title_len);
data/libtoxcore-0.2.12/toxcore/group.c:1117: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(g->real_pk, nc_get_self_public_key(g_c->m->net_crypto), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:1207: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(pk, peer->real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:1256: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(name, peer->nick, peer->nick_len);
data/libtoxcore-0.2.12/toxcore/group.c:1404: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(id, g->id, sizeof(g->id));
data/libtoxcore-0.2.12/toxcore/group.c:1425: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(packet + 1, &group_num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:1426: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(packet + 1 + sizeof(uint16_t), data, length);
data/libtoxcore-0.2.12/toxcore/group.c:1446: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(packet + 1, &group_num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:1447: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(packet + 1 + sizeof(uint16_t), data, length);
data/libtoxcore-0.2.12/toxcore/group.c:1474: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(invite + 1, &groupchat_num, sizeof(groupchat_num));
data/libtoxcore-0.2.12/toxcore/group.c:1476: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(invite + 1 + sizeof(groupchat_num) + 1, g->id, GROUP_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/group.c:1500: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(packet + 2, g->id, GROUP_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/group.c:1559: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(g->real_pk, nc_get_self_public_key(g_c->m->net_crypto), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:1579: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(response + 1 + sizeof(uint16_t), data, length);
data/libtoxcore-0.2.12/toxcore/group.c:1591: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(g->id, data + sizeof(uint16_t) + 1, GROUP_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/group.c:1742: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(packet, &peer_num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:1743: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(packet + sizeof(uint16_t), real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:1744: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(packet + sizeof(uint16_t) + CRYPTO_PUBLIC_KEY_SIZE, temp_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:1761: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(packet, &peer_num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:1778: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(packet, &peer_num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:1845: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(g->title, title, title_len);
data/libtoxcore-0.2.12/toxcore/group.c:1897: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(title, g->title, g->title_len);
data/libtoxcore-0.2.12/toxcore/group.c:2080: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(packet + 1, &group_num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2082: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(packet + 1 + sizeof(uint16_t) + 1, id, GROUP_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/group.c:2102: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(&other_groupnum, data, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2236: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(p, &peer_num, sizeof(peer_num));
data/libtoxcore-0.2.12/toxcore/group.c:2238: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(p, g->group[i].real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:2240: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(p, g->group[i].temp_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:2244: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(p, g->group[i].nick, g->group[i].nick_len);
data/libtoxcore-0.2.12/toxcore/group.c:2251: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(title_packet + 1, g->title, g->title_len);
data/libtoxcore-0.2.12/toxcore/group.c:2483: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(packet, &peer_num, sizeof(peer_num));
data/libtoxcore-0.2.12/toxcore/group.c:2492: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(packet + sizeof(uint16_t), &message_num, sizeof(message_num));
data/libtoxcore-0.2.12/toxcore/group.c:2497: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(packet + sizeof(uint16_t) + sizeof(uint32_t) + 1, data, len);
data/libtoxcore-0.2.12/toxcore/group.c:2555: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(packet, &peer_number, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2557: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(packet + sizeof(uint16_t), &message_num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2558: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(packet + sizeof(uint16_t) * 2, data, length);
data/libtoxcore-0.2.12/toxcore/group.c:2634: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(&peer_number, data, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2699: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(&new_peer_number, msg_data, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2713: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(&kill_peer_number, msg_data, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2749: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(newmsg, msg_data, msg_data_len);
data/libtoxcore-0.2.12/toxcore/group.c:2766: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(newmsg, msg_data, msg_data_len);
data/libtoxcore-0.2.12/toxcore/group.c:2809: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(&groupnumber, data + 1, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2911: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(&groupnumber, data + 1, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2912: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(&peer_number, data + 1 + sizeof(uint16_t), sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:2913: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(&message_number, data + 1 + sizeof(uint16_t) * 2, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/group.c:3184: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(data, peer->real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:3187: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(data, peer->temp_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/group.c:3199: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(data, peer->nick, peer->nick_len);
data/libtoxcore-0.2.12/toxcore/group.c:3235: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(data, g->id, GROUP_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/group.c:3253: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(data, g->title, g->title_len);
data/libtoxcore-0.2.12/toxcore/group.c:3330: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(g->id, data, GROUP_ID_LENGTH);
data/libtoxcore-0.2.12/toxcore/group.c:3365: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(g->title, data, g->title_len);
data/libtoxcore-0.2.12/toxcore/group.c:3399: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(peer->nick, data, peer->nick_len);
data/libtoxcore-0.2.12/toxcore/group.c:3411: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(g->real_pk, nc_get_self_public_key(g_c->m->net_crypto), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/list.c:209: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(list->data + i * list->element_size, data, list->element_size);
data/libtoxcore-0.2.12/toxcore/logger.c:114: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 msg[1024];
data/libtoxcore-0.2.12/toxcore/net_crypto.c:220: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(plain, c->self_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:221: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(plain + CRYPTO_PUBLIC_KEY_SIZE, padding, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:222: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(plain + (CRYPTO_PUBLIC_KEY_SIZE * 2), &number, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:228: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(packet + 1, dht_get_self_public_key(c->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:229: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(packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:250: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(contents, &temp_time, sizeof(temp_time));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:251: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(contents + sizeof(temp_time), bytes, COOKIE_DATA_LENGTH);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:286: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(bytes, contents + sizeof(cookie_time), COOKIE_DATA_LENGTH);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:302: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(cookie_plain, request_plain, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:303: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(cookie_plain + CRYPTO_PUBLIC_KEY_SIZE, dht_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:310: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(plain + COOKIE_LENGTH, request_plain + COOKIE_DATA_LENGTH, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:336: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(dht_public_key, packet + 1, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:449: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(cookie, plain, COOKIE_LENGTH);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:450: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(number, plain + COOKIE_LENGTH, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:467: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(plain, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:468: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(plain + CRYPTO_NONCE_SIZE, session_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:471: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(cookie_plain, peer_real_pk, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:472: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(cookie_plain + CRYPTO_PUBLIC_KEY_SIZE, peer_dht_pubkey, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:488: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(packet + 1, cookie, COOKIE_LENGTH);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:547: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(nonce, plain, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:548: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(session_pk, plain + CRYPTO_NONCE_SIZE, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:549: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(cookie, plain + CRYPTO_NONCE_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_SHA512_SIZE, COOKIE_LENGTH);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:550: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(peer_real_pk, cookie_plain, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:551: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(dht_public_key, cookie_plain + CRYPTO_PUBLIC_KEY_SIZE, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:762: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(new_d, data, sizeof(Packet_Data));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:815: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(new_d, data, sizeof(Packet_Data));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:839: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(data, array->buffer[num], sizeof(Packet_Data));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1074: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(packet + 1, conn->sent_nonce + (CRYPTO_NONCE_SIZE - sizeof(uint16_t)), sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1104: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(packet, &buffer_start, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1105: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(packet + sizeof(uint32_t), &num, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1107: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(packet + (sizeof(uint32_t) * 2) + padding_length, data, length);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1169: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(dt.data, data, length);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1202: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(&num, nonce + (CRYPTO_NONCE_SIZE - sizeof(uint16_t)), sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1231: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(nonce, conn->recv_nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1354: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(temp_packet, packet, length);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1514: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(&buffer_start, data, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1515: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(&num, data + sizeof(uint32_t), sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1580: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(dt.data, real_data, real_length);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1966: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(conn->recv_nonce, n_c.recv_nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:1967: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(conn->peersessionpublic_key, n_c.peersessionpublic_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2023: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(conn->public_key, n_c->public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2024: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(conn->recv_nonce, n_c->recv_nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2025: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(conn->peersessionpublic_key, n_c->peersessionpublic_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2039: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(conn->dht_public_key, n_c->dht_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2080: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(conn->public_key, real_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2088: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(conn->dht_public_key, dht_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2954: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(keys, c->self_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2955: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(keys + CRYPTO_PUBLIC_KEY_SIZE, c->self_secret_key, CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/net_crypto.c:2963: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(c->self_secret_key, sk, CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/network.c:286: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(addr->s6_addr, ip.uint8, sizeof(ip.uint8));
data/libtoxcore-0.2.12/toxcore/network.c:454: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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/toxcore/network.c:915:13:  [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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/toxcore/network.c:942: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 ip_str[IP_NTOA_LEN];
data/libtoxcore-0.2.12/toxcore/network.c:1383: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(&ip_port->ip.ip.v4, &addr->sin_addr, sizeof(IP4));
data/libtoxcore-0.2.12/toxcore/network.c:1386: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(&ip_port->ip.ip.v6, &addr->sin6_addr, sizeof(IP6));
data/libtoxcore-0.2.12/toxcore/onion.c:47: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(data + 1, source.ip.v4.uint8, SIZE_IP4);
data/libtoxcore-0.2.12/toxcore/onion.c:49: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(data + 1, source.ip.v6.uint8, SIZE_IP6);
data/libtoxcore-0.2.12/toxcore/onion.c:64: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(target->ip.v4.uint8, data + 1, SIZE_IP4);
data/libtoxcore-0.2.12/toxcore/onion.c:66: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(target->ip.v6.uint8, data + 1, SIZE_IP6);
data/libtoxcore-0.2.12/toxcore/onion.c:79: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(data + SIZE_IP, &source->port, SIZE_PORT);
data/libtoxcore-0.2.12/toxcore/onion.c:93: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(&target->port, data + SIZE_IP, SIZE_PORT);
data/libtoxcore-0.2.12/toxcore/onion.c:114: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(new_path->public_key1, dht_get_self_public_key(dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:121: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(new_path->public_key2, random_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:125: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(new_path->public_key3, random_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:131: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(new_path->node_public_key1, nodes[0].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:132: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(new_path->node_public_key2, nodes[1].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:133: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(new_path->node_public_key3, nodes[2].public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:153: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(nodes[0].public_key, path->node_public_key1, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:154: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(nodes[1].public_key, path->node_public_key2, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:155: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(nodes[2].public_key, path->node_public_key3, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:178: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(step1 + SIZE_IPPORT, data, length);
data/libtoxcore-0.2.12/toxcore/onion.c:185: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(step2 + SIZE_IPPORT, path->public_key3, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:196: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(step3 + SIZE_IPPORT, path->public_key2, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:205: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(packet + 1, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:206: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(packet + 1 + CRYPTO_NONCE_SIZE, path->public_key1, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:237: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(step1 + SIZE_IPPORT, data, length);
data/libtoxcore-0.2.12/toxcore/onion.c:244: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(step2 + SIZE_IPPORT, path->public_key3, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:254: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(packet + CRYPTO_NONCE_SIZE + SIZE_IPPORT, path->public_key2, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:262: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(packet, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:305: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(packet + 1, ret, RETURN_3);
data/libtoxcore-0.2.12/toxcore/onion.c:306: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(packet + 1 + RETURN_3, data, length);
data/libtoxcore-0.2.12/toxcore/onion.c:364: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(data + 1, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:365: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(data + 1 + CRYPTO_NONCE_SIZE, plain + SIZE_IPPORT, len - SIZE_IPPORT);
data/libtoxcore-0.2.12/toxcore/onion.c:418: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(data + 1, packet + 1, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/onion.c:419: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(data + 1 + CRYPTO_NONCE_SIZE, plain + SIZE_IPPORT, len - SIZE_IPPORT);
data/libtoxcore-0.2.12/toxcore/onion.c:425: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(ret_data + SIZE_IPPORT, packet + (length - RETURN_1), RETURN_1);
data/libtoxcore-0.2.12/toxcore/onion.c:483: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(data, plain + SIZE_IPPORT, len - SIZE_IPPORT);
data/libtoxcore-0.2.12/toxcore/onion.c:489: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(ret_data + SIZE_IPPORT, packet + (length - RETURN_2), RETURN_2);
data/libtoxcore-0.2.12/toxcore/onion.c:542: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(data + 1, plain + SIZE_IPPORT, RETURN_2);
data/libtoxcore-0.2.12/toxcore/onion.c:543: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(data + 1 + RETURN_2, packet + 1 + RETURN_3, length - (1 + RETURN_3));
data/libtoxcore-0.2.12/toxcore/onion.c:588: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(data + 1, plain + SIZE_IPPORT, RETURN_1);
data/libtoxcore-0.2.12/toxcore/onion.c:589: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(data + 1 + RETURN_1, packet + 1 + RETURN_2, length - (1 + RETURN_2));
data/libtoxcore-0.2.12/toxcore/onion_announce.c:81: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(plain, ping_id, ONION_PING_ID_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:82: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(plain + ONION_PING_ID_SIZE, client_id, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:83: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(plain + ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE, data_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:84: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(plain + ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE, &sendback_data,
data/libtoxcore-0.2.12/toxcore/onion_announce.c:97: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(packet + 1 + CRYPTO_NONCE_SIZE, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:124: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(packet + 1, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:125: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(packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:131: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(packet + 1 + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_NONCE_SIZE, random_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:228: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(data, onion_a->secret_bytes, CRYPTO_SYMMETRIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:229: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(data + CRYPTO_SYMMETRIC_KEY_SIZE, &time, sizeof(time));
data/libtoxcore-0.2.12/toxcore/onion_announce.c:230: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(data + CRYPTO_SYMMETRIC_KEY_SIZE + sizeof(time), public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:231: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(data + CRYPTO_SYMMETRIC_KEY_SIZE + sizeof(time) + CRYPTO_PUBLIC_KEY_SIZE, &ret_ip_port, sizeof(ret_ip_port));
data/libtoxcore-0.2.12/toxcore/onion_announce.c:263: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(&cmp1, a, sizeof(Cmp_data));
data/libtoxcore-0.2.12/toxcore/onion_announce.c:264: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(&cmp2, b, sizeof(Cmp_data));
data/libtoxcore-0.2.12/toxcore/onion_announce.c:346: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(onion_a->entries[pos].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:348: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(onion_a->entries[pos].ret, ret, ONION_RETURN_3);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:349: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(onion_a->entries[pos].data_public_key, data_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:409: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(pl + 1, ping_id2, ONION_PING_ID_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:414: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(pl + 1, ping_id2, ONION_PING_ID_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:417: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(pl + 1, ping_id2, ONION_PING_ID_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:421: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(pl + 1, onion_a->entries[index].data_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:444: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(data + 1, plain + ONION_PING_ID_SIZE + CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_PUBLIC_KEY_SIZE,
data/libtoxcore-0.2.12/toxcore/onion_announce.c:446: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(data + 1 + ONION_ANNOUNCE_SENDBACK_DATA_LENGTH, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_announce.c:477: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(data + 1, packet + 1 + CRYPTO_PUBLIC_KEY_SIZE, length - (1 + CRYPTO_PUBLIC_KEY_SIZE + ONION_RETURN_3));
data/libtoxcore-0.2.12/toxcore/onion_client.c:168: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(onion_c->path_nodes_bs[onion_c->path_nodes_index_bs % MAX_PATH_NODES].public_key, public_key,
data/libtoxcore-0.2.12/toxcore/onion_client.c:201: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(onion_c->path_nodes[onion_c->path_nodes_index % MAX_PATH_NODES].public_key, public_key,
data/libtoxcore-0.2.12/toxcore/onion_client.c:405: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(path, &onion_paths->paths[pathnum], sizeof(Onion_Path));
data/libtoxcore-0.2.12/toxcore/onion_client.c:512: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(data, &num, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/onion_client.c:513: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(data + sizeof(uint32_t), public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:514: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(data + sizeof(uint32_t) + CRYPTO_PUBLIC_KEY_SIZE, &ip_port, sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/onion_client.c:515: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(data + sizeof(uint32_t) + CRYPTO_PUBLIC_KEY_SIZE + sizeof(IP_Port), &path_num, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/onion_client.c:539: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(&sback, sendback, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/onion_client.c:546: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(ret_pubkey, data + sizeof(uint32_t), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:547: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(ret_ip_port, data + sizeof(uint32_t) + CRYPTO_PUBLIC_KEY_SIZE, sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/onion_client.c:548: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(path_num, data + sizeof(uint32_t) + CRYPTO_PUBLIC_KEY_SIZE + sizeof(IP_Port), sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/onion_client.c:551: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(&num, data, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/onion_client.c:614: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(&cmp1, a, sizeof(Onion_Client_Cmp_data));
data/libtoxcore-0.2.12/toxcore/onion_client.c:615: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(&cmp2, b, sizeof(Onion_Client_Cmp_data));
data/libtoxcore-0.2.12/toxcore/onion_client.c:723: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(list_nodes[index].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:730: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(list_nodes[index].data_public_key, pingid_or_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:732: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(list_nodes[index].ping_id, pingid_or_key, ONION_PING_ID_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:761: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(last_pinged[*last_pinged_index % MAX_STORED_PINGED_NODES].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:1072: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(packet, nc_get_self_public_key(onion_c->c), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:1127: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(temp, nc_get_self_public_key(onion_c->c), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:1128: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(temp + CRYPTO_PUBLIC_KEY_SIZE, nonce, CRYPTO_NONCE_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:1196: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(data + 1 + sizeof(uint64_t), dht_get_self_public_key(onion_c->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:1311: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(onion_c->friends_list[index].real_public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:1417: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(onion_c->friends_list[friend_num].dht_public_key, dht_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/onion_client.c:1441: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(dht_key, onion_c->friends_list[friend_num].dht_public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/ping.c:65: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(data + CRYPTO_PUBLIC_KEY_SIZE, &ipp, sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/ping.c:74: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(ping_plain + 1, &ping_id, sizeof(ping_id));
data/libtoxcore-0.2.12/toxcore/ping.c:105: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(ping_plain + 1, &ping_id, sizeof(ping_id));
data/libtoxcore-0.2.12/toxcore/ping.c:216: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(&ipp, data + CRYPTO_PUBLIC_KEY_SIZE, sizeof(IP_Port));
data/libtoxcore-0.2.12/toxcore/ping.c:290: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(ping->to_ping[i].public_key, public_key, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/ping_array.c:121: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(array->entries[index].data, data, length);
data/libtoxcore-0.2.12/toxcore/ping_array.c:164: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(data, array->entries[index].data, array->entries[index].length);
data/libtoxcore-0.2.12/toxcore/state.c:98: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(dest, &num, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/state.c:104: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(&d, lendian, sizeof(uint64_t));
data/libtoxcore-0.2.12/toxcore/state.c:119: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(dest, &num, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/state.c:125: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(&d, lendian, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/state.c:138: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(dest, &num, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/state.c:144: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(&d, lendian, sizeof(uint16_t));
data/libtoxcore-0.2.12/toxcore/tox.c:380: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(data32, data, sizeof(uint32_t));
data/libtoxcore-0.2.12/toxcore/tox.c:847: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(public_key, nc_get_self_public_key(tox->m->net_crypto), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/tox.c:856: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(secret_key, nc_get_self_secret_key(tox->m->net_crypto), CRYPTO_SECRET_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/tox.c:2263: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(dht_id, dht_get_self_public_key(tox->m->dht), CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxcore/util.c:35: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(dest, src, CRYPTO_PUBLIC_KEY_SIZE);
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h:62:44:  [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.
int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_pwhash_scryptsalsa208sha256.h:69:57:  [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.
int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c:173: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(dst, setting, prefixlen + saltlen);
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c:69: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(key, passwd, passwdlen);
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c:72: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(salt_and_ivec, salt, saltlen);
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c:78: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(T, U, 32);
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pbkdf2-sha256.c:92: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(&buf[i * 32], T, clen);
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c:130:40:  [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.
crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c:137: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            setting[crypto_pwhash_scryptsalsa208sha256_STRSETTINGBYTES + 1U];
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c:182: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.
crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES],
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c:186: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            wanted[crypto_pwhash_scryptsalsa208sha256_STRBYTES];
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:92: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(salt, data, crypto_pwhash_scryptsalsa208sha256_SALTBYTES);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:154: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(out_key->salt, salt, crypto_pwhash_scryptsalsa208sha256_SALTBYTES);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:155: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(out_key->key, key, CRYPTO_SHARED_KEY_SIZE);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:185: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(out, TOX_ENC_SAVE_MAGIC_NUMBER, TOX_ENC_SAVE_MAGIC_LENGTH);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:189: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(out, key->salt, crypto_pwhash_scryptsalsa208sha256_SALTBYTES);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:194: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(out, nonce, crypto_box_NONCEBYTES);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:266: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(nonce, data, crypto_box_NONCEBYTES);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:307: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(salt, data + TOX_ENC_SAVE_MAGIC_LENGTH, crypto_pwhash_scryptsalsa208sha256_SALTBYTES);
data/libtoxcore-0.2.12/auto_tests/file_saving_test.c:36:49:  [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).
    tox_self_set_name(t, (const uint8_t *)name, strlen(name), nullptr);
data/libtoxcore-0.2.12/auto_tests/file_saving_test.c:52:36:  [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).
                                   strlen(pphrase), cipher,
data/libtoxcore-0.2.12/auto_tests/file_saving_test.c:80:76:  [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).
    ck_assert_msg(tox_pass_decrypt(cipher, size, (const uint8_t *)pphrase, strlen(pphrase), clear, &derr),
data/libtoxcore-0.2.12/auto_tests/messenger_test.c:48: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).
    int good_len = strlen(message);
data/libtoxcore-0.2.12/auto_tests/messenger_test.c:84:28:  [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).
    uint16_t good_length = strlen(status);
data/libtoxcore-0.2.12/auto_tests/messenger_test.c:132: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).
    int good_len = strlen(good_data);
data/libtoxcore-0.2.12/auto_tests/messenger_test.c:133:19:  [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).
    int bad_len = strlen(bad_data);
data/libtoxcore-0.2.12/auto_tests/messenger_test.c:166:23:  [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).
    int good_length = strlen(good_name);
data/libtoxcore-0.2.12/auto_tests/messenger_test.c:180:18:  [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).
    size_t len = strlen(nickname);
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:15:28:  [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 EXPECTED_NAME_SIZE strlen(EXPECTED_NAME)
data/libtoxcore-0.2.12/auto_tests/save_compatibility_test.c:17: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).
#define EXPECTED_STATUS_MESSAGE_SIZE strlen(EXPECTED_STATUS_MESSAGE)
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:170:37:  [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).
    *pid_file_path = (char *)malloc(strlen(tmp_pid_file) + 1);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:182: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).
    *keys_file_path = (char *)malloc(strlen(tmp_keys_file) + 1);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:240: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).
        size_t tmp_motd_length = strlen(tmp_motd) + 1;
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:243:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(*motd, tmp_motd, motd_length);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:293:9:  [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 (strlen(hex_string) % 2 != 0) {
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:297:18:  [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).
    size_t len = strlen(hex_string) / 2;
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/config.c:382:13:  [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 (strlen(bs_public_key) != CRYPTO_PUBLIC_KEY_SIZE * 2) {
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:45:32:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
#define SLEEP_MILLISECONDS(MS) usleep(1000*MS)
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:215:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(077);
data/libtoxcore-0.2.12/other/bootstrap_daemon/src/tox-bootstrapd.c:360:95:  [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 (bootstrap_set_callbacks(dht_get_net(dht), DAEMON_VERSION_NUMBER, (uint8_t *)motd, strlen(motd) + 1) == 0) {
data/libtoxcore-0.2.12/other/fun/cracker.c:42: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).
    uint32_t len = strlen(argv[1]) / 2;
data/libtoxcore-0.2.12/other/fun/save-generator.c:118: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).
    tox_self_set_name(tox, name, strlen((const char *)name), &err);
data/libtoxcore-0.2.12/other/fun/save-generator.c:124:81:  [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).
    tox_self_set_status_message(tox, (const uint8_t *)GENERATED_STATUS_MESSAGE, strlen(GENERATED_STATUS_MESSAGE), &err);
data/libtoxcore-0.2.12/other/fun/save-generator.c:133:82:  [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).
        tox_friend_add(tox, address, (const uint8_t *)GENERATED_REQUEST_MESSAGE, strlen(GENERATED_REQUEST_MESSAGE),
data/libtoxcore-0.2.12/other/fun/strkey.c:70: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).
        len = strlen(desired_hex);
data/libtoxcore-0.2.12/super_donators/grencez_tok5.c:24:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define RecvPd()  read(fd[0], &xpd, sizeof(xpd))
data/libtoxcore-0.2.12/testing/DHT_test.c:199:10:  [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 ((strlen(temp_id) > 0) && (temp_id[strlen(temp_id) - 1] == '\n')) {
data/libtoxcore-0.2.12/testing/DHT_test.c:199:43:  [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 ((strlen(temp_id) > 0) && (temp_id[strlen(temp_id) - 1] == '\n')) {
data/libtoxcore-0.2.12/testing/DHT_test.c:200:17:  [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).
        temp_id[strlen(temp_id) - 1] = '\0';
data/libtoxcore-0.2.12/testing/Messenger_test.c:147:10:  [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 ((strlen(temp_hex_id) > 0) && (temp_hex_id[strlen(temp_hex_id) - 1] == '\n')) {
data/libtoxcore-0.2.12/testing/Messenger_test.c:147:51:  [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 ((strlen(temp_hex_id) > 0) && (temp_hex_id[strlen(temp_hex_id) - 1] == '\n')) {
data/libtoxcore-0.2.12/testing/Messenger_test.c:148:21:  [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).
        temp_hex_id[strlen(temp_hex_id) - 1] = '\0';
data/libtoxcore-0.2.12/testing/misc_tools.c:60:21:  [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).
    size_t i, len = strlen(hex_string) / 2;
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:24:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bool read(T **p) {
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:108:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  EXPECT_TRUE(rb.read(&retrieved));
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:121:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  EXPECT_FALSE(rb.read(&retrieved));
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:129:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  EXPECT_FALSE(rb.read(&retrieved));
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:170:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  rb.read(&retrieved);
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:172:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  rb.read(&retrieved);
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:174:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  rb.read(&retrieved);
data/libtoxcore-0.2.12/toxav/ring_buffer_test.cc:176:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  rb.read(&retrieved);
data/libtoxcore-0.2.12/toxcore/network.c:1144:32:  [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).
            const size_t len = strlen(ip_str);
data/libtoxcore-0.2.12/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c:154:19:  [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).
        saltlen = strlen((const char *)salt);
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:32:46:  [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.
#error TOX_PASS_SALT_LENGTH is assumed to be equal to crypto_pwhash_scryptsalsa208sha256_SALTBYTES
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:36:45:  [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.
#error TOX_PASS_KEY_LENGTH is assumed to be equal to CRYPTO_SHARED_KEY_SIZE
data/libtoxcore-0.2.12/toxencryptsave/toxencryptsave.c:40:58:  [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.
#error TOX_PASS_ENCRYPTION_EXTRA_LENGTH is assumed to be equal to (crypto_box_MACBYTES + crypto_box_NONCEBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES + TOX_ENC_SAVE_MAGIC_LENGTH)

ANALYSIS SUMMARY:

Hits = 622
Lines analyzed = 62318 in approximately 1.46 seconds (42637 lines/second)
Physical Source Lines of Code (SLOC) = 37672
Hits@level = [0] 430 [1]  47 [2] 557 [3]   4 [4]  13 [5]   1
Hits@level+ = [0+] 1052 [1+] 622 [2+] 575 [3+]  18 [4+]  14 [5+]   1
Hits/KSLOC@level+ = [0+] 27.9252 [1+] 16.5109 [2+] 15.2633 [3+] 0.477808 [4+] 0.371629 [5+] 0.0265449
Dot directories skipped = 4 (--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.