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/wireguard-linux-compat-1.0.20201112/src/allowedips.c Examining data/wireguard-linux-compat-1.0.20201112/src/allowedips.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/checksum/checksum_partial_compat.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/compat-asm.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/compat.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/dst_cache/dst_cache.c Examining data/wireguard-linux-compat-1.0.20201112/src/compat/dst_cache/include/net/dst_cache.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/fpu-x86/include/asm/fpu/api.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/intel-family-x86/include/asm/intel-family.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/memneq/include.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/memneq/memneq.c Examining data/wireguard-linux-compat-1.0.20201112/src/compat/neon-arm/include/asm/neon.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/ptr_ring/include/linux/ptr_ring.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/simd-asm/include/asm/simd.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/simd/include/linux/simd.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/siphash/include/linux/siphash.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/siphash/siphash.c Examining data/wireguard-linux-compat-1.0.20201112/src/compat/udp_tunnel/include/net/udp_tunnel.h Examining data/wireguard-linux-compat-1.0.20201112/src/compat/udp_tunnel/udp_tunnel.c Examining data/wireguard-linux-compat-1.0.20201112/src/compat/udp_tunnel/udp_tunnel_partial_compat.h Examining data/wireguard-linux-compat-1.0.20201112/src/cookie.c Examining data/wireguard-linux-compat-1.0.20201112/src/cookie.h Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/include/zinc/blake2s.h Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/include/zinc/chacha20.h Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/include/zinc/chacha20poly1305.h Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/include/zinc/curve25519.h Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/include/zinc/poly1305.h Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc.h Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s-x86_64-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/chacha20/chacha20-arm-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/chacha20/chacha20-mips-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/chacha20/chacha20-x86_64-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/chacha20/chacha20.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/chacha20poly1305.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-arm-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-fiat32.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-x86_64-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-x86_64.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305-arm-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305-donna32.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305-donna64.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305-mips-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305-x86_64-glue.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/blake2s.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/chacha20.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/chacha20poly1305.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/curve25519.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/poly1305.c Examining data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/run.h Examining data/wireguard-linux-compat-1.0.20201112/src/device.c Examining data/wireguard-linux-compat-1.0.20201112/src/device.h Examining data/wireguard-linux-compat-1.0.20201112/src/main.c Examining data/wireguard-linux-compat-1.0.20201112/src/messages.h Examining data/wireguard-linux-compat-1.0.20201112/src/netlink.c Examining data/wireguard-linux-compat-1.0.20201112/src/netlink.h Examining data/wireguard-linux-compat-1.0.20201112/src/noise.c Examining data/wireguard-linux-compat-1.0.20201112/src/noise.h Examining data/wireguard-linux-compat-1.0.20201112/src/peer.c Examining data/wireguard-linux-compat-1.0.20201112/src/peer.h Examining data/wireguard-linux-compat-1.0.20201112/src/peerlookup.c Examining data/wireguard-linux-compat-1.0.20201112/src/peerlookup.h Examining data/wireguard-linux-compat-1.0.20201112/src/queueing.c Examining data/wireguard-linux-compat-1.0.20201112/src/queueing.h Examining data/wireguard-linux-compat-1.0.20201112/src/ratelimiter.c Examining data/wireguard-linux-compat-1.0.20201112/src/ratelimiter.h Examining data/wireguard-linux-compat-1.0.20201112/src/receive.c Examining data/wireguard-linux-compat-1.0.20201112/src/selftest/allowedips.c Examining data/wireguard-linux-compat-1.0.20201112/src/selftest/counter.c Examining data/wireguard-linux-compat-1.0.20201112/src/selftest/ratelimiter.c Examining data/wireguard-linux-compat-1.0.20201112/src/send.c Examining data/wireguard-linux-compat-1.0.20201112/src/socket.c Examining data/wireguard-linux-compat-1.0.20201112/src/socket.h Examining data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c Examining data/wireguard-linux-compat-1.0.20201112/src/timers.c Examining data/wireguard-linux-compat-1.0.20201112/src/timers.h Examining data/wireguard-linux-compat-1.0.20201112/src/uapi/wireguard.h Examining data/wireguard-linux-compat-1.0.20201112/src/version.h FINAL RESULTS: data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:181:3: [4] (shell) execl: 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. execl("/init.sh", "init", NULL); data/wireguard-linux-compat-1.0.20201112/src/allowedips.c:29:2: [2] (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->bits, src, bits / 8U); data/wireguard-linux-compat-1.0.20201112/src/compat/compat.h:674:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp, data, len); data/wireguard-linux-compat-1.0.20201112/src/cookie.c:165:2: [2] (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->latest_cookie.last_mac1_sent, macs->mac1, COOKIE_LEN); data/wireguard-linux-compat-1.0.20201112/src/cookie.c:224:3: [2] (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->latest_cookie.cookie, cookie, COOKIE_LEN); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:79:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(block, key, keylen); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:115:3: [2] (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, block, BLAKE2S_BLOCK_SIZE); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:117:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(v, state->h, 32); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:177:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->buf + state->buflen, in, fill); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:190:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(state->buf + state->buflen, in, inlen); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:202:2: [2] (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, state->h, state->outlen); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:219:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(x_key, key, keylen); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/blake2s/blake2s.c:237:2: [2] (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, i_hash, outlen); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/chacha20/chacha20.c:149:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(derived_key + 0, x + 0, sizeof(u32) * 4); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/chacha20/chacha20.c:150:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(derived_key + 4, x + 12, sizeof(u32) * 4); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-fiat32.c:762:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(e, scalar, 32); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:283:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, input, 5 * sizeof(*input)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:355:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp, b, 5 * sizeof(*b)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:466:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output, input, 5 * sizeof(*input)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:467:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(output + 5, input + 5, 5 * sizeof(*input)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:490:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(origx, x, 5 * sizeof(*x)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:493:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(origxprime0, xprime, 5 * sizeof(*xprime)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:510:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(origxprime, xxprime, 5 * sizeof(*xxprime)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-hacl64.c:764:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(e, secret, 32); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-x86_64.c:846:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p11, init1, (u32)8U * sizeof(init1[0U])); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-x86_64.c:886:2: [2] (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, p0, (u32)8U * sizeof(p0[0U])); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-x86_64.c:1334:2: [2] (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, priv, 32); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/curve25519/curve25519-x86_64.c:1341:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(x2, p_minus_s, sizeof(p_minus_s)); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305.c:93:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->data + num, input, len); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305.c:97:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->data + num, input, rem); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/poly1305/poly1305.c:113:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->data, input, rem); data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/chacha20.c:2566:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(offset_input + 1, chacha20_testvecs[i].input, data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/chacha20.c:2568:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(offset_key + 1, chacha20_testvecs[i].key, data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/chacha20.c:2631:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(offset_input + j, chacha20_testvecs[i].input, data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/chacha20poly1305.c:8919:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(computed_output, chacha20poly1305_enc_vectors[i].input, data/wireguard-linux-compat-1.0.20201112/src/crypto/zinc/selftest/chacha20poly1305.c:8963:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(computed_output, chacha20poly1305_dec_vectors[i].input, data/wireguard-linux-compat-1.0.20201112/src/netlink.c:429:3: [2] (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->handshake.preshared_key, preshared_key, data/wireguard-linux-compat-1.0.20201112/src/netlink.c:444:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&endpoint.addr, addr, len); data/wireguard-linux-compat-1.0.20201112/src/noise.c:69:2: [2] (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->remote_static, peer_public_key, NOISE_PUBLIC_KEY_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:71:3: [2] (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->preshared_key, peer_preshared_key, data/wireguard-linux-compat-1.0.20201112/src/noise.c:298:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(static_identity->static_private, private_key, data/wireguard-linux-compat-1.0.20201112/src/noise.c:335:2: [2] (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_dst, output, first_len); data/wireguard-linux-compat-1.0.20201112/src/noise.c:344:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(second_dst, output, second_len); data/wireguard-linux-compat-1.0.20201112/src/noise.c:353:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(third_dst, output, third_len); data/wireguard-linux-compat-1.0.20201112/src/noise.c:427:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hash, handshake_init_hash, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:428:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(chaining_key, handshake_init_chaining_key, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:460:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ephemeral_dst, ephemeral_src, NOISE_PUBLIC_KEY_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:613:2: [2] (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->remote_ephemeral, e, NOISE_PUBLIC_KEY_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:615:3: [2] (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->latest_timestamp, t, NOISE_TIMESTAMP_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:616:2: [2] (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->hash, hash, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:617:2: [2] (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->chaining_key, chaining_key, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:724:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(hash, handshake->hash, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:725:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(chaining_key, handshake->chaining_key, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:726:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ephemeral_private, handshake->ephemeral_private, data/wireguard-linux-compat-1.0.20201112/src/noise.c:728:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(preshared_key, handshake->preshared_key, data/wireguard-linux-compat-1.0.20201112/src/noise.c:763:2: [2] (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->remote_ephemeral, e, NOISE_PUBLIC_KEY_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:764:2: [2] (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->hash, hash, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/noise.c:765:2: [2] (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->chaining_key, chaining_key, NOISE_HASH_LEN); data/wireguard-linux-compat-1.0.20201112/src/selftest/allowedips.c:52:3: [2] (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, &node->peer, sizeof(node->peer)); data/wireguard-linux-compat-1.0.20201112/src/selftest/allowedips.c:318:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mutated, ip, 4); data/wireguard-linux-compat-1.0.20201112/src/selftest/allowedips.c:362:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mutated, ip, 16); data/wireguard-linux-compat-1.0.20201112/src/selftest/allowedips.c:609:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((u8 *)&ip + (i < 64) * 8, &part, 8); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:65:12: [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 buffer[256]; data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:74:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/urandom", O_WRONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:117:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/proc/sys/kernel/printk", O_WRONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:123:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/proc/sys/debug/exception-trace", O_WRONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:129:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/proc/sys/kernel/panic_on_warn", O_WRONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:140:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[2048], *start, *pass; data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:143:9: [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 = fopen("/proc/kmsg", "r"); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:172:2: [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 cmdline[4096], *success_dev; data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:188:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/proc/cmdline", O_RDONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:197:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(success_dev + 11 - 5, "/dev/", 5); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:204:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(success_dev, O_WRONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:228:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open("/dev/console", O_RDWR); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:247:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/sys/kernel/debug/kmemleak", O_WRONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:259:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/sys/kernel/debug/kmemleak", O_WRONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:267:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/sys/kernel/debug/kmemleak", O_RDONLY); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:55:8: [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(" WireGuard Test Suite on ") + strlen(utsname.sysname) + strlen(utsname.release) + strlen(utsname.machine); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:55:55: [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(" WireGuard Test Suite on ") + strlen(utsname.sysname) + strlen(utsname.release) + strlen(utsname.machine); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:55: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). len = strlen(" WireGuard Test Suite on ") + strlen(utsname.sysname) + strlen(utsname.release) + strlen(utsname.machine); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:55:107: [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(" WireGuard Test Suite on ") + strlen(utsname.sysname) + strlen(utsname.release) + strlen(utsname.machine); data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:191:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, cmdline, sizeof(cmdline) - 1) <= 0) data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:201:24: [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 (!success_dev || !strlen(success_dev)) data/wireguard-linux-compat-1.0.20201112/src/tests/qemu/init.c:230:4: [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. usleep(50000); ANALYSIS SUMMARY: Hits = 84 Lines analyzed = 33432 in approximately 1.33 seconds (25119 lines/second) Physical Source Lines of Code (SLOC) = 29397 Hits@level = [0] 6 [1] 7 [2] 76 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 90 [1+] 84 [2+] 77 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 3.06154 [1+] 2.85743 [2+] 2.61931 [3+] 0.0340171 [4+] 0.0340171 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.