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/mrd6-0.9.6/tools/c/mrd6sh.c Examining data/mrd6-0.9.6/include/mrdpriv/linux/unicast_route.h Examining data/mrd6-0.9.6/include/mrdpriv/linux/us_mfa.h Examining data/mrd6-0.9.6/include/mrdpriv/linux/icmp_raw.h Examining data/mrd6-0.9.6/include/mrdpriv/dummy/rib.h Examining data/mrd6-0.9.6/include/mrdpriv/dummy/mfa.h Examining data/mrd6-0.9.6/include/mrdpriv/bsd/rib.h Examining data/mrd6-0.9.6/include/mrdpriv/bsd/mfa.h Examining data/mrd6-0.9.6/include/mrdpriv/bgp/def.h Examining data/mrd6-0.9.6/include/mrdpriv/mld/router.h Examining data/mrd6-0.9.6/include/mrdpriv/mld/def.h Examining data/mrd6-0.9.6/include/mrdpriv/icmp_inet6.h Examining data/mrd6-0.9.6/include/mrdpriv/console/console.h Examining data/mrd6-0.9.6/include/mrdpriv/pim/interface.h Examining data/mrd6-0.9.6/include/mrdpriv/pim/router.h Examining data/mrd6-0.9.6/include/mrdpriv/pim/def.h Examining data/mrd6-0.9.6/include/mrdpriv/pim/group.h Examining data/mrd6-0.9.6/include/mrdpriv/pim/neighbour.h Examining data/mrd6-0.9.6/include/mrd/packet_buffer.h Examining data/mrd6-0.9.6/include/mrd/mrib.h Examining data/mrd6-0.9.6/include/mrd/router.h Examining data/mrd6-0.9.6/include/mrd/parser.h Examining data/mrd6-0.9.6/include/mrd/node.h Examining data/mrd6-0.9.6/include/mrd/timers.h Examining data/mrd6-0.9.6/include/mrd/rib.h Examining data/mrd6-0.9.6/include/mrd/source_discovery.h Examining data/mrd6-0.9.6/include/mrd/icmp.h Examining data/mrd6-0.9.6/include/mrd/mrd.h Examining data/mrd6-0.9.6/include/mrd/group.h Examining data/mrd6-0.9.6/include/mrd/address_set.h Examining data/mrd6-0.9.6/include/mrd/support/uint_n.h Examining data/mrd6-0.9.6/include/mrd/support/objpool.h Examining data/mrd6-0.9.6/include/mrd/support/refcount.h Examining data/mrd6-0.9.6/include/mrd/support/lists.h Examining data/mrd6-0.9.6/include/mrd/support/ptree.h Examining data/mrd6-0.9.6/include/mrd/address.h Examining data/mrd6-0.9.6/include/mrd/mfa.h Examining data/mrd6-0.9.6/include/mrd/log.h Examining data/mrd6-0.9.6/include/mrd/interface.h Examining data/mrd6-0.9.6/src/linux/linux_icmp_raw.cpp Examining data/mrd6-0.9.6/src/linux/us_mfa.cpp Examining data/mrd6-0.9.6/src/linux/mrd_components.cpp Examining data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp Examining data/mrd6-0.9.6/src/dummy/mrd_components.cpp Examining data/mrd6-0.9.6/src/dummy/dummy.cpp Examining data/mrd6-0.9.6/src/router.cpp Examining data/mrd6-0.9.6/src/icmp.cpp Examining data/mrd6-0.9.6/src/bsd/bsd_rib.cpp Examining data/mrd6-0.9.6/src/bsd/mrd_components.cpp Examining data/mrd6-0.9.6/src/bsd/bsd_mfa.cpp Examining data/mrd6-0.9.6/src/rib.cpp Examining data/mrd6-0.9.6/src/mfa.cpp Examining data/mrd6-0.9.6/src/main.cpp Examining data/mrd6-0.9.6/src/bgp/bgp_def.cpp Examining data/mrd6-0.9.6/src/bgp/bgp.cpp Examining data/mrd6-0.9.6/src/mld/mld_conf.cpp Examining data/mrd6-0.9.6/src/mld/mld_router.cpp Examining data/mrd6-0.9.6/src/mld/mld_def.cpp Examining data/mrd6-0.9.6/src/mld/mld_module.cpp Examining data/mrd6-0.9.6/src/tests/stress-mrib.cpp Examining data/mrd6-0.9.6/src/tests/ptree_unittest.cpp Examining data/mrd6-0.9.6/src/tests/address_unittest.cpp Examining data/mrd6-0.9.6/src/tests/mrib_unittest.cpp Examining data/mrd6-0.9.6/src/ripng/ripng.cpp Examining data/mrd6-0.9.6/src/mrib.cpp Examining data/mrd6-0.9.6/src/zebra/zebra.cpp Examining data/mrd6-0.9.6/src/address_set.cpp Examining data/mrd6-0.9.6/src/icmp_inet6.cpp Examining data/mrd6-0.9.6/src/extra/coredumper.cpp Examining data/mrd6-0.9.6/src/extra/mld_ext.cpp Examining data/mrd6-0.9.6/src/address.cpp Examining data/mrd6-0.9.6/src/console/unix_console.cpp Examining data/mrd6-0.9.6/src/console/console.cpp Examining data/mrd6-0.9.6/src/console/telnet_console.cpp Examining data/mrd6-0.9.6/src/mrdisc/mrdisc_module.cpp Examining data/mrd6-0.9.6/src/mrdisc/mrdisc_def.h Examining data/mrd6-0.9.6/src/no-modules.cpp Examining data/mrd6-0.9.6/src/group.cpp Examining data/mrd6-0.9.6/src/pim/pim_group.cpp Examining data/mrd6-0.9.6/src/pim/pim_neighbour.cpp Examining data/mrd6-0.9.6/src/pim/pim_bsr.cpp Examining data/mrd6-0.9.6/src/pim/pim_interface.cpp Examining data/mrd6-0.9.6/src/pim/pim_source.cpp Examining data/mrd6-0.9.6/src/pim/test-cases/hashmask.c Examining data/mrd6-0.9.6/src/pim/pim_module.cpp Examining data/mrd6-0.9.6/src/pim/pim_router.cpp Examining data/mrd6-0.9.6/src/pim/pim_def.cpp Examining data/mrd6-0.9.6/src/pim/pim_conf.cpp Examining data/mrd6-0.9.6/src/pim/pim_oif.cpp Examining data/mrd6-0.9.6/src/node.cpp Examining data/mrd6-0.9.6/src/msnip/msnip_module.cpp Examining data/mrd6-0.9.6/src/msnip/msnip_def.h Examining data/mrd6-0.9.6/src/support/ptree.cpp Examining data/mrd6-0.9.6/src/support/objpool.cpp Examining data/mrd6-0.9.6/src/parser.cpp Examining data/mrd6-0.9.6/src/timers.cpp Examining data/mrd6-0.9.6/src/log.cpp Examining data/mrd6-0.9.6/src/interface.cpp Examining data/mrd6-0.9.6/src/mrd.cpp FINAL RESULTS: data/mrd6-0.9.6/src/console/unix_console.cpp:49:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(socketPath, 0, grp->gr_gid) != 0) data/mrd6-0.9.6/src/console/unix_console.cpp:52:9: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. return chmod(socketPath, 0660) == 0; data/mrd6-0.9.6/include/mrd/log.h:88:15: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. base_stream &printf(const char *, ...); data/mrd6-0.9.6/src/console/console.cpp:152:3: [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(unlhaddr.sun_path, socketPath); data/mrd6-0.9.6/src/linux/us_mfa.cpp:203:8: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. out.printf(format, rate, unit); data/mrd6-0.9.6/src/linux/us_mfa.cpp:377:8: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. out.printf(format, rate, unit); data/mrd6-0.9.6/src/log.cpp:98:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. base_stream &base_stream::printf(const char *fmt, ...) { data/mrd6-0.9.6/src/log.cpp:103:11: [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 k = vsnprintf(req_buffer(192), 192, fmt, vl); data/mrd6-0.9.6/src/log.cpp:248: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. commit_change(vsnprintf(req_buffer(n), n, fmt, vl)); data/mrd6-0.9.6/src/mrd.cpp:1046:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(defaultconffiles[k], R_OK) == 0) { data/mrd6-0.9.6/src/mrd.cpp:1948:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path.c_str(), F_OK) == 0) data/mrd6-0.9.6/src/timers.cpp:333:10: [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 w = vsnprintf(buf + ptr, avail, fmt, vl); data/mrd6-0.9.6/src/timers.cpp:409:6: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ctx.printf(fmt, "timer name", "time left", "interval", "repeat").newl(); data/mrd6-0.9.6/src/timers.cpp:420:7: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ctx.printf(fmt, h->name.c_str(), buf1, buf2, data/mrd6-0.9.6/tools/c/mrd6sh.c:20:2: [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(buf, argv[1]); data/mrd6-0.9.6/tools/c/mrd6sh.c:28:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf + ptr, " %s", argv[i]); data/mrd6-0.9.6/tools/c/mrd6sh.c:43:2: [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(addr.sun_path, MRD_SOCKET); data/mrd6-0.9.6/tools/c/mrd6sh.c:57:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(buf); data/mrd6-0.9.6/src/main.cpp:56:14: [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 ((c = getopt_long(argc, argv, "DAhf:m:", longopts, &optint)) != -1) { data/mrd6-0.9.6/src/mrd.cpp:981:2: [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(get_random_seed()); data/mrd6-0.9.6/include/mrd/log.h:221: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 buffer[256]; data/mrd6-0.9.6/include/mrdpriv/console/console.h:160:11: [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[1024]; data/mrd6-0.9.6/src/address.cpp:116: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 buf[64]; data/mrd6-0.9.6/src/address.cpp:130:5: [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(buf + l + 1, "%i", prefixlen); data/mrd6-0.9.6/src/bgp/bgp.cpp:1008:3: [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 foo[64]; data/mrd6-0.9.6/src/bgp/bgp.cpp:1450:21: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). bgp_open_message open(msg); data/mrd6-0.9.6/src/bgp/bgp.cpp:1451: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). if (open.decode(ibuf)) { data/mrd6-0.9.6/src/bgp/bgp.cpp:1452:22: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!handle_open(open)) { data/mrd6-0.9.6/src/bgp/bgp_def.cpp:107: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(buff.put(16), good_marker, 16); data/mrd6-0.9.6/src/bgp/bgp_def.cpp:313:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&prefix.addr, b.eat(plen), plen); data/mrd6-0.9.6/src/bgp/bgp_def.cpp:338:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&prefix.addr, b.eat(plen), plen); data/mrd6-0.9.6/src/bgp/bgp_def.cpp:436: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(b.put(len), &i->addr, len); data/mrd6-0.9.6/src/bsd/bsd_rib.cpp:278: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 name[IFNAMSIZ]; data/mrd6-0.9.6/src/console/console.cpp:385:3: [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[64]; data/mrd6-0.9.6/src/console/console.cpp:521:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64]; data/mrd6-0.9.6/src/console/console.cpp:786:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[Cols]; data/mrd6-0.9.6/src/console/telnet_console.cpp:419:11: [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 op[5]; data/mrd6-0.9.6/src/console/telnet_console.cpp:433: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 code[3]; data/mrd6-0.9.6/src/extra/coredumper.cpp:76: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 filename[256]; data/mrd6-0.9.6/src/extra/coredumper.cpp:78:2: [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(filename, "coredump-%u", (uint32_t)time(0)); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:74: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(RTA_DATA(rta), data, len); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:379: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. desc.name = (const char *)RTA_DATA(tb[IFLA_IFNAME]); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:411: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(&addr.addr, RTA_DATA(arta), RTA_PAYLOAD(arta)); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:493: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(&reply.nexthop, RTA_DATA(tb[RTA_GATEWAY]), sizeof(in6_addr)); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:495: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(&reply.source, RTA_DATA(tb[RTA_PREFSRC]), sizeof(in6_addr)); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:574: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 *rt_p = fopen(RT_PROTOS_PATH, "r"); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:580: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_b[256]; data/mrd6-0.9.6/src/linux/us_mfa.cpp:524:17: [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). m_framesize = atoi(g_mrd->get_property_string("mfa-framesize")); data/mrd6-0.9.6/src/linux/us_mfa.cpp:532:17: [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). m_mmapedlen = atoi(g_mrd->get_property_string("mfa-mmap-size")); data/mrd6-0.9.6/src/linux/us_mfa.cpp:700: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(sa.sll_addr + 2, hdr->ip6_dst.s6_addr + 12, 4); data/mrd6-0.9.6/src/linux/us_mfa.cpp:746: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(buffer + sizeof(icmp6_hdr), hdr, howmuch); data/mrd6-0.9.6/src/log.cpp:280:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/mrd6-0.9.6/src/log.cpp:353:8: [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). _fp = fopen(filename, "a"); data/mrd6-0.9.6/src/log.cpp:382: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 tmp[64]; data/mrd6-0.9.6/src/log.cpp:398:10: [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). _fp = fopen(_base_filename.c_str(), "a"); data/mrd6-0.9.6/src/mrd.cpp:176:7: [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). fp = fopen(filename, "r"); data/mrd6-0.9.6/src/mrd.cpp:934:11: [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(path, O_RDONLY | O_NONBLOCK); data/mrd6-0.9.6/src/pim/pim_group.cpp:45: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(embrp.addr.s6_addr, addr.s6_addr + 4, data/mrd6-0.9.6/src/pim/pim_group.cpp:948: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(msg->ip6_header(), hdr, len); data/mrd6-0.9.6/src/pim/pim_interface.cpp:113: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 tmrname[128]; data/mrd6-0.9.6/src/pim/pim_interface.cpp:1006: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->pktbuf, pktbuf, pktlen); data/mrd6-0.9.6/src/pim/pim_source.cpp:1276: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(msg->ip6_header(), &dummy, sizeof(dummy)); data/mrd6-0.9.6/src/pim/test-cases/hashmask.c:9: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 buf[64]; data/mrd6-0.9.6/src/pim/test-cases/hashmask.c:13:9: [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). mask = atoi(argv[2]); data/mrd6-0.9.6/src/tests/ptree_unittest.cpp:21: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 tmp[32]; data/mrd6-0.9.6/src/timers.cpp:383: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 buf[64]; data/mrd6-0.9.6/src/timers.cpp:405: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 fmt[64]; data/mrd6-0.9.6/src/timers.cpp:412: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 buf1[64], buf2[64]; data/mrd6-0.9.6/src/zebra/zebra.cpp:256:2: [2] (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). Risk is low because the source is a constant string. strcpy(zebraaddr.sun_path, "/var/run/quagga/zserv.api"); data/mrd6-0.9.6/src/zebra/zebra.cpp:389: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 name[INTERFACE_NAMSIZ+1]; data/mrd6-0.9.6/src/zebra/zebra.cpp:392: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(name, ibuf.eat(INTERFACE_NAMSIZ), INTERFACE_NAMSIZ); data/mrd6-0.9.6/src/zebra/zebra.cpp:432: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(&addr.addr, ibuf.eat(16), 16); data/mrd6-0.9.6/src/zebra/zebra.cpp:436: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(&dest, ibuf.eat(16), 16); data/mrd6-0.9.6/src/zebra/zebra.cpp:488: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(&prefix.addr, ibuf.eat(blen), blen); data/mrd6-0.9.6/src/zebra/zebra.cpp:497: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(&nexthop, ibuf.eat(sizeof(in6_addr)), data/mrd6-0.9.6/src/zebra/zebra.cpp:550: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(obuf.put(sizeof(in6_addr)), &addr, sizeof(in6_addr)); data/mrd6-0.9.6/src/zebra/zebra.cpp:573:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&nexthop, ibuf.eat(sizeof(in6_addr)), data/mrd6-0.9.6/src/zebra/zebra.cpp:578:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&nexthop, ibuf.eat(sizeof(in6_addr)), data/mrd6-0.9.6/tools/c/mrd6sh.c:12: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 buf[256]; data/mrd6-0.9.6/include/mrd/log.h:241: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). assert(strncmp(currfmt + 1, param, strlen(param)) == 0); data/mrd6-0.9.6/include/mrd/log.h:243: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). currfmt += 1 + strlen(param); data/mrd6-0.9.6/include/mrd/parser.h:80:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(); data/mrd6-0.9.6/src/address.cpp:45: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). os.commit_change(strlen(p)); data/mrd6-0.9.6/src/address.cpp:50: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). os.commit_change(strlen(p)); data/mrd6-0.9.6/src/address.cpp:125:11: [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 l = strlen(buf); data/mrd6-0.9.6/src/bsd/bsd_rib.cpp:336:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int l = read(evsock.fd(), buffer, sizeof(buffer)); data/mrd6-0.9.6/src/bsd/bsd_rib.cpp:443:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int l = read(evsock.fd(), buffer, sizeof(buffer)); data/mrd6-0.9.6/src/console/console.cpp:81:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strncmp(base, oper, strlen(base)) == 0; data/mrd6-0.9.6/src/console/console.cpp:708:29: [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 (send(sock.fd(), what, strlen(what), MSG_DONTWAIT) < 0) { data/mrd6-0.9.6/src/console/console.cpp:784:14: [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 dl = strlen(desc); data/mrd6-0.9.6/src/console/console.cpp:790:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, desc, k); data/mrd6-0.9.6/src/linux/linux_unicast_route.cpp:584: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). line_b[strlen(line_b)-1] = 0; data/mrd6-0.9.6/src/log.cpp:95: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). append_chunk(str, strlen(str)); data/mrd6-0.9.6/src/log.cpp:200:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer + ptr, str, x); data/mrd6-0.9.6/src/mrd.cpp:221:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((res = ctx.read()) < 1) data/mrd6-0.9.6/src/mrd.cpp:268:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((res = ctx.read()) < 1) data/mrd6-0.9.6/src/mrd.cpp:320:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((res = ctx.read()) < 1) data/mrd6-0.9.6/src/mrd.cpp:938:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int len = read(fd, value, 4); data/mrd6-0.9.6/src/node.cpp:871:16: [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 mlen = strlen(match); data/mrd6-0.9.6/src/node.cpp:893:16: [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 (mlen == strlen(tent)) { data/mrd6-0.9.6/src/parser.cpp:114:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int parser_context::read() { data/mrd6-0.9.6/src/parser.cpp:143:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((res = read()) < 1) data/mrd6-0.9.6/src/timers.cpp:347:3: [1] (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). Risk is low because the source is a constant character. strcpy(buf, "0"); data/mrd6-0.9.6/src/timers.cpp:470: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). os.commit_change(strlen(p)); data/mrd6-0.9.6/tools/c/mrd6sh.c:21: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). ptr = strlen(buf); data/mrd6-0.9.6/tools/c/mrd6sh.c:24:14: [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 ((ptr + strlen(argv[i])) >= sizeof(buf)) { data/mrd6-0.9.6/tools/c/mrd6sh.c:29:14: [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). ptr += 1 + strlen(argv[i]); ANALYSIS SUMMARY: Hits = 107 Lines analyzed = 37349 in approximately 0.80 seconds (46670 lines/second) Physical Source Lines of Code (SLOC) = 25670 Hits@level = [0] 56 [1] 28 [2] 59 [3] 2 [4] 16 [5] 2 Hits@level+ = [0+] 163 [1+] 107 [2+] 79 [3+] 20 [4+] 18 [5+] 2 Hits/KSLOC@level+ = [0+] 6.34982 [1+] 4.16829 [2+] 3.07752 [3+] 0.77912 [4+] 0.701208 [5+] 0.077912 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.