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/arptables-0.0.5/libarptc/libarptc_incl.c Examining data/arptables-0.0.5/libarptc/libarptc.c Examining data/arptables-0.0.5/include/linux/netfilter_arp/arpt_mangle.h Examining data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h Examining data/arptables-0.0.5/include/linux/netfilter_arp.h Examining data/arptables-0.0.5/include/linux/netfilter/x_tables.h Examining data/arptables-0.0.5/include/libarptc/libarptc.h Examining data/arptables-0.0.5/include/libarptc/arpt_kernel_headers.h Examining data/arptables-0.0.5/include/arptables_common.h Examining data/arptables-0.0.5/include/arptables.h Examining data/arptables-0.0.5/extensions/arpt_standard.c Examining data/arptables-0.0.5/extensions/arpt_mangle.c Examining data/arptables-0.0.5/extensions/arpt_MARK.c Examining data/arptables-0.0.5/extensions/arpt_CLASSIFY.c Examining data/arptables-0.0.5/arptables.c Examining data/arptables-0.0.5/arptables-standalone.c FINAL RESULTS: data/arptables-0.0.5/arptables.c:445:2: [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(stderr, msg, args); data/arptables-0.0.5/arptables.c:832: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(vianame, arg); data/arptables-0.0.5/arptables.c:945:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "/%s", addr_to_dotted(mask)); data/arptables-0.0.5/arptables.c:1122: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. printf(FMT("%4"PRIu64"T ","%"PRIu64"T "), number); data/arptables-0.0.5/arptables.c:1124:11: [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. else printf(FMT("%4"PRIu64"G ","%"PRIu64"G "), number); data/arptables-0.0.5/arptables.c:1126:10: [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. else printf(FMT("%4"PRIu64"M ","%"PRIu64"M "), number); data/arptables-0.0.5/arptables.c:1128:5: [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(FMT("%4"PRIu64"K ","%"PRIu64"K "), number); data/arptables-0.0.5/arptables.c:1130:4: [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(FMT("%5"PRIu64" ","%"PRIu64" "), number); data/arptables-0.0.5/arptables.c:1132: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(FMT("%8"PRIu64" ","%"PRIu64" "), number); data/arptables-0.0.5/arptables.c:1241:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(iface, fw->arp.iniface); data/arptables-0.0.5/arptables.c:1256:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(iface, fw->arp.outiface); data/arptables-0.0.5/arptables.c:1271:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_dotted(&(fw->arp.src))); data/arptables-0.0.5/arptables.c:1273:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_anyname(&(fw->arp.src))); data/arptables-0.0.5/arptables.c:1295:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_dotted(&(fw->arp.tgt))); data/arptables-0.0.5/arptables.c:1297:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_anyname(&(fw->arp.tgt))); data/arptables-0.0.5/arptables.c:1555: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(chains + i*sizeof(arpt_chainlabel), chain); data/arptables-0.0.5/arptables.c:1707:3: [4] (shell) execv: 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. execv(argv[0], argv); data/arptables-0.0.5/arptables.c:2167:8: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(pcnt, "%"PRIu64, data/arptables-0.0.5/arptables.c:2173:8: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(bcnt, "%"PRIu64, data/arptables-0.0.5/arptables.c:2394:4: [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(target->t->u.user.name, jumpto); data/arptables-0.0.5/extensions/arpt_mangle.c:159:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_dotted(&(m->u_s.src_ip))); data/arptables-0.0.5/extensions/arpt_mangle.c:161:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_anyname(&(m->u_s.src_ip))); data/arptables-0.0.5/extensions/arpt_mangle.c:171:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_dotted(&(m->u_t.tgt_ip))); data/arptables-0.0.5/extensions/arpt_mangle.c:173:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s", addr_to_anyname(&(m->u_t.tgt_ip))); data/arptables-0.0.5/include/arptables_common.h:18:17: [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. format(printf,2,3))); data/arptables-0.0.5/libarptc/libarptc_incl.c:233: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(info.name, tablename); data/arptables-0.0.5/libarptc/libarptc_incl.c:823: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(t->target.u.user.name, STANDARD_TARGET); data/arptables-0.0.5/libarptc/libarptc_incl.c:1333: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(newc.name.target.u.user.name, ERROR_TARGET); data/arptables-0.0.5/libarptc/libarptc_incl.c:1335: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(newc.name.errorname, chain); data/arptables-0.0.5/libarptc/libarptc_incl.c:1341: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(newc.target.target.u.user.name, STANDARD_TARGET); data/arptables-0.0.5/libarptc/libarptc_incl.c:1474: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(t->errorname, newname); data/arptables-0.0.5/libarptc/libarptc_incl.c:1600: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(repl->name, (*handle)->info.name); data/arptables-0.0.5/libarptc/libarptc_incl.c:1636: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(newcounters->name, (*handle)->info.name); data/arptables-0.0.5/arptables.c:1826: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, data/arptables-0.0.5/libarptc/libarptc_incl.c:94:28: [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. #define CHECK(h) do { if (!getenv("ARPTC_NO_CHECK")) do_check((h), __LINE__); } while(0) data/arptables-0.0.5/arptables.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. static const char optflags[NUMBER_OF_OPT] data/arptables-0.0.5/arptables.c:180:8: [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 char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] = data/arptables-0.0.5/arptables.c:251:10: [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 mac_type_unicast[ETH_ALEN] = {0,0,0,0,0,0}; data/arptables-0.0.5/arptables.c:252:10: [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 msk_type_unicast[ETH_ALEN] = {1,0,0,0,0,0}; data/arptables-0.0.5/arptables.c:253:10: [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 mac_type_multicast[ETH_ALEN] = {1,0,0,0,0,0}; data/arptables-0.0.5/arptables.c:254:10: [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 msk_type_multicast[ETH_ALEN] = {1,0,0,0,0,0}; data/arptables-0.0.5/arptables.c:255:10: [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 mac_type_broadcast[ETH_ALEN] = {255,255,255,255,255,255}; data/arptables-0.0.5/arptables.c:256:10: [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 msk_type_broadcast[ETH_ALEN] = {255,255,255,255,255,255}; data/arptables-0.0.5/arptables.c:283: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(to, mac_type_unicast, ETH_ALEN); data/arptables-0.0.5/arptables.c:284: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(mask, msk_type_unicast, ETH_ALEN); data/arptables-0.0.5/arptables.c:288: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(to, mac_type_multicast, ETH_ALEN); data/arptables-0.0.5/arptables.c:289: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(mask, msk_type_multicast, ETH_ALEN); data/arptables-0.0.5/arptables.c:293: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(to, mac_type_broadcast, ETH_ALEN); data/arptables-0.0.5/arptables.c:294: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(mask, msk_type_broadcast, ETH_ALEN); data/arptables-0.0.5/arptables.c:301: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(mask, addr, ETH_ALEN); data/arptables-0.0.5/arptables.c:306: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(to, addr, ETH_ALEN); data/arptables-0.0.5/arptables.c:387: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[20]; data/arptables-0.0.5/arptables.c:760: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/arptables-0.0.5/arptables.c:775:3: [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(buf, "0.0.0.0"); data/arptables-0.0.5/arptables.c:904: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. static char buf[20]; data/arptables-0.0.5/arptables.c:908: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(buf, "%d.%d.%d.%d", bytep[0], bytep[1], bytep[2], bytep[3]); data/arptables-0.0.5/arptables.c:928: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. static char buf[20]; data/arptables-0.0.5/arptables.c:942:3: [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, "/%d", i); data/arptables-0.0.5/arptables.c:1040: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(merge, oldopts, num_old * sizeof(struct option)); data/arptables-0.0.5/arptables.c:1220: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[BUFSIZ]; data/arptables-0.0.5/arptables.c:1222: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 iface[IFNAMSIZ+2]; data/arptables-0.0.5/arptables.c:1247:8: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. else strcat(iface, "any"); data/arptables-0.0.5/arptables.c:1262:8: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. else strcat(iface, "any"); data/arptables-0.0.5/arptables.c:1666:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). procfile = open(PROC_SYS_MODPROBE, O_RDONLY); data/arptables-0.0.5/arptables.c:1692: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 *argv[3]; data/arptables-0.0.5/arptables.c:1759: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->elems + size, target, target->u.target_size); data/arptables-0.0.5/extensions/arpt_mangle.c:111: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(mangle->src_devaddr, macaddr, e->arp.arhln); data/arptables-0.0.5/extensions/arpt_mangle.c:126: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(mangle->tgt_devaddr, macaddr, e->arp.arhln); data/arptables-0.0.5/extensions/arpt_mangle.c:155: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[100]; data/arptables-0.0.5/include/libarptc/libarptc.h:19:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef char arpt_chainlabel[32]; data/arptables-0.0.5/include/linux/netfilter/x_tables.h:16:4: [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[XT_EXTENSION_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter/x_tables.h:30: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 data[0]; data/arptables-0.0.5/include/linux/netfilter/x_tables.h:39:4: [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[XT_EXTENSION_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter/x_tables.h:53: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 data[0]; data/arptables-0.0.5/include/linux/netfilter/x_tables.h:71: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 errorname[XT_FUNCTION_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter/x_tables.h:77: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[XT_EXTENSION_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter/x_tables.h: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 name[XT_TABLE_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:35: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 addr[ARPT_DEV_ADDR_LEN_MAX]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:36: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 mask[ARPT_DEV_ADDR_LEN_MAX]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:62: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 iniface[IFNAMSIZ], outiface[IFNAMSIZ]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:63: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 iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:108: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 elems[0]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:133: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[XT_TABLE_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:155: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[XT_TABLE_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter_arp/arp_tables.h:186: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[XT_TABLE_MAXNAMELEN]; data/arptables-0.0.5/include/linux/netfilter_arp/arpt_mangle.h:8: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 src_devaddr[ARPT_DEV_ADDR_LEN_MAX]; data/arptables-0.0.5/include/linux/netfilter_arp/arpt_mangle.h: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 tgt_devaddr[ARPT_DEV_ADDR_LEN_MAX]; data/arptables-0.0.5/libarptc/libarptc_incl.c:45: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[TABLE_MAXNAMELEN]; data/arptables-0.0.5/libarptc/libarptc_incl.c:720: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(newh->entries.entrytable, (*handle)->entries.entrytable,offset); data/arptables-0.0.5/libarptc/libarptc_incl.c:722: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((char *)newh->entries.entrytable + offset, insert, rules_size); data/arptables-0.0.5/libarptc/libarptc_incl.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((char *)newh->entries.entrytable + offset + rules_size, data/arptables-0.0.5/libarptc/libarptc_incl.c:730: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(newh->counter_map, (*handle)->counter_map, data/arptables-0.0.5/libarptc/libarptc_incl.c:733: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(newh->counter_map + num_rules_offset + num_rules, data/arptables-0.0.5/libarptc/libarptc_incl.c:1072: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(fw, origfw, origfw->next_offset); data/arptables-0.0.5/libarptc/libarptc_incl.c:1289: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->counters, counters, sizeof(STRUCT_COUNTERS)); data/arptables-0.0.5/libarptc/libarptc_incl.c:1524: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->counters, counters, sizeof(STRUCT_COUNTERS)); data/arptables-0.0.5/libarptc/libarptc_incl.c:1609: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(repl->entries, (*handle)->entries.entrytable, data/arptables-0.0.5/libarptc/libarptc_incl.c:1673: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(&newcounters->counters[i], data/arptables-0.0.5/arptables.c:390:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, dotted, sizeof(buf) - 1); data/arptables-0.0.5/arptables.c:764:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, name, sizeof(buf) - 1); data/arptables-0.0.5/arptables.c:821: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). int vialen = strlen(arg); data/arptables-0.0.5/arptables.c:874:6: [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(targetname) < 1) data/arptables-0.0.5/arptables.c:878:6: [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(targetname)+1 > sizeof(arpt_chainlabel)) data/arptables-0.0.5/arptables.c:1246:29: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. if (format & FMT_NUMERIC) strcat(iface, "*"); data/arptables-0.0.5/arptables.c:1261:29: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. if (format & FMT_NUMERIC) strcat(iface, "*"); data/arptables-0.0.5/arptables.c:1274:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, mask_to_dotted(&(fw->arp.smsk)), sizeof(buf) - strlen(buf) -1); data/arptables-0.0.5/arptables.c:1274:63: [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). strncat(buf, mask_to_dotted(&(fw->arp.smsk)), sizeof(buf) - strlen(buf) -1); data/arptables-0.0.5/arptables.c:1298:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, mask_to_dotted(&(fw->arp.tmsk)), sizeof(buf) - strlen(buf) -1); data/arptables-0.0.5/arptables.c:1298:64: [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). strncat(buf, mask_to_dotted(&(fw->arp.tmsk)), sizeof(buf) - strlen(buf) -1); data/arptables-0.0.5/arptables.c:1672:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read_bytes = read(procfile, ret, 1024); data/arptables-0.0.5/arptables.c:1678: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). if (ret[strlen(ret)-1]=='\n') data/arptables-0.0.5/arptables.c:1679: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). ret[strlen(ret)-1]=0; data/arptables-0.0.5/arptables.c:2068:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(target->t->u.user.name, jumpto, sizeof(target->t->u.user.name) - 1); data/arptables-0.0.5/arptables.c:2329:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (chain && strlen(chain) > ARPT_FUNCTION_MAXNAMELEN) data/arptables-0.0.5/arptables.c:2383: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). && (strlen(jumpto) == 0 data/arptables-0.0.5/libarptc/libarptc_incl.c:202:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(h->info.name, tablename, sizeof(h->info.name) - 1); data/arptables-0.0.5/libarptc/libarptc_incl.c:203:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(h->entries.name, tablename, sizeof(h->entries.name) - 1); data/arptables-0.0.5/libarptc/libarptc_incl.c:229:6: [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(tablename) >= TABLE_MAXNAMELEN) { data/arptables-0.0.5/libarptc/libarptc_incl.c:335:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(h->cache_chain_heads[h->cache_num_chains].name, data/arptables-0.0.5/libarptc/libarptc_incl.c:347:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(h->cache_chain_heads[h->cache_num_chains].name, data/arptables-0.0.5/libarptc/libarptc_incl.c:868:26: [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). memset(t->u.user.name + strlen(t->u.user.name), data/arptables-0.0.5/libarptc/libarptc_incl.c:870:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). FUNCTION_MAXNAMELEN - 1 - strlen(t->u.user.name)); data/arptables-0.0.5/libarptc/libarptc_incl.c:1323:6: [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(chain)+1 > sizeof(ARPT_CHAINLABEL)) { data/arptables-0.0.5/libarptc/libarptc_incl.c:1461:6: [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(newname)+1 > sizeof(ARPT_CHAINLABEL)) { ANALYSIS SUMMARY: Hits = 124 Lines analyzed = 6196 in approximately 0.19 seconds (33155 lines/second) Physical Source Lines of Code (SLOC) = 4448 Hits@level = [0] 121 [1] 26 [2] 63 [3] 2 [4] 33 [5] 0 Hits@level+ = [0+] 245 [1+] 124 [2+] 98 [3+] 35 [4+] 33 [5+] 0 Hits/KSLOC@level+ = [0+] 55.0809 [1+] 27.8777 [2+] 22.0324 [3+] 7.86871 [4+] 7.41906 [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.