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/batctl-2020.4/aggregation.c Examining data/batctl-2020.4/allocate.h Examining data/batctl-2020.4/ap_isolation.c Examining data/batctl-2020.4/backbonetable.c Examining data/batctl-2020.4/bat-hosts.c Examining data/batctl-2020.4/bat-hosts.h Examining data/batctl-2020.4/batadv_packet.h Examining data/batctl-2020.4/batman_adv.h Examining data/batctl-2020.4/bisect_iv.c Examining data/batctl-2020.4/bisect_iv.h Examining data/batctl-2020.4/bonding.c Examining data/batctl-2020.4/bridge_loop_avoidance.c Examining data/batctl-2020.4/claimtable.c Examining data/batctl-2020.4/dat_cache.c Examining data/batctl-2020.4/debug.c Examining data/batctl-2020.4/debug.h Examining data/batctl-2020.4/debugfs.c Examining data/batctl-2020.4/debugfs.h Examining data/batctl-2020.4/distributed_arp_table.c Examining data/batctl-2020.4/elp_interval.c Examining data/batctl-2020.4/event.c Examining data/batctl-2020.4/fragmentation.c Examining data/batctl-2020.4/functions.c Examining data/batctl-2020.4/functions.h Examining data/batctl-2020.4/gateways.c Examining data/batctl-2020.4/genl.c Examining data/batctl-2020.4/genl.h Examining data/batctl-2020.4/gw_mode.c Examining data/batctl-2020.4/hash.c Examining data/batctl-2020.4/hash.h Examining data/batctl-2020.4/hop_penalty.c Examining data/batctl-2020.4/icmp_helper.c Examining data/batctl-2020.4/icmp_helper.h Examining data/batctl-2020.4/interface.c Examining data/batctl-2020.4/isolation_mark.c Examining data/batctl-2020.4/list.h Examining data/batctl-2020.4/loglevel.c Examining data/batctl-2020.4/main.c Examining data/batctl-2020.4/main.h Examining data/batctl-2020.4/mcast_flags.c Examining data/batctl-2020.4/multicast_fanout.c Examining data/batctl-2020.4/multicast_forceflood.c Examining data/batctl-2020.4/multicast_mode.c Examining data/batctl-2020.4/nc_nodes.c Examining data/batctl-2020.4/neighbors.c Examining data/batctl-2020.4/netlink.c Examining data/batctl-2020.4/netlink.h Examining data/batctl-2020.4/network_coding.c Examining data/batctl-2020.4/orig_interval.c Examining data/batctl-2020.4/originators.c Examining data/batctl-2020.4/ping.c Examining data/batctl-2020.4/routing_algo.c Examining data/batctl-2020.4/statistics.c Examining data/batctl-2020.4/sys.c Examining data/batctl-2020.4/sys.h Examining data/batctl-2020.4/tcpdump.c Examining data/batctl-2020.4/tcpdump.h Examining data/batctl-2020.4/throughput_override.c Examining data/batctl-2020.4/throughputmeter.c Examining data/batctl-2020.4/traceroute.c Examining data/batctl-2020.4/transglobal.c Examining data/batctl-2020.4/translate.c Examining data/batctl-2020.4/translocal.c FINAL RESULTS: data/batctl-2020.4/debugfs.c:41:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. return snprintf(buffer, size, fmt, debugfs_mountpoint, mesh_iface); data/batctl-2020.4/functions.c:393:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, mesh_iface); data/batctl-2020.4/functions.c:1073:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, data/batctl-2020.4/functions.c:1131:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, sizeof(path_buff), SYS_MESH_IFACE_FMT, hard_iface); data/batctl-2020.4/gw_mode.c:374:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, state->mesh_iface); data/batctl-2020.4/interface.c:169:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, sizeof(path_buff), SYS_IFACE_STATUS_FMT, data/batctl-2020.4/loglevel.c:148:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, state->mesh_iface); data/batctl-2020.4/routing_algo.c:204:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT, iface_dir->d_name); data/batctl-2020.4/sys.c:279:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, data/batctl-2020.4/sys.c:286:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_VLAN_PATH, data/batctl-2020.4/sys.c:294:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(path_buff, PATH_BUFF_LEN, SYS_HARDIF_PATH, data/batctl-2020.4/bat-hosts.c:174:12: [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. homedir = getenv("HOME"); data/batctl-2020.4/bat-hosts.c:190:8: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (!realpath(confdir, normalized + (i * PATH_MAX))) data/batctl-2020.4/bisect_iv.c:1441:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "hl:no:r:s:t:")) != -1) { data/batctl-2020.4/debug.c:57:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "hnw:t:Humi:")) != -1) { data/batctl-2020.4/event.c:437:16: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "htr")) != -1) { data/batctl-2020.4/functions.c:1207:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(now.tv_sec ^ now.tv_nsec); data/batctl-2020.4/gw_mode.c:357:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "h")) != -1) { data/batctl-2020.4/interface.c:396:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "hM")) != -1) { data/batctl-2020.4/loglevel.c:131:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "h")) != -1) { data/batctl-2020.4/main.c:334:16: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "+hm:v")) != -1) { data/batctl-2020.4/ping.c:77:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "hc:i:t:RT")) != -1) { data/batctl-2020.4/routing_algo.c:171:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "h")) != -1) { data/batctl-2020.4/sys.c:258:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "h")) != -1) { data/batctl-2020.4/tcpdump.c:1326:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "chnp:x:")) != -1) { data/batctl-2020.4/throughputmeter.c:400:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "t:n")) != -1) { data/batctl-2020.4/traceroute.c:56:20: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((optchar = getopt(argc, argv, "hnT")) != -1) { data/batctl-2020.4/bat-hosts.c:26:7: [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. const char *bat_hosts_path[3] = {"/etc/bat-hosts", "~/bat-hosts", "bat-hosts"}; data/batctl-2020.4/bat-hosts.c:57: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[HOST_NAME_MAX_LEN], mac_str[18]; data/batctl-2020.4/bat-hosts.c:65: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). fd = fopen(path, "r"); data/batctl-2020.4/bat-hosts.c:122: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(&bat_host->mac_addr, mac_addr, sizeof(struct ether_addr)); data/batctl-2020.4/bat-hosts.c:149: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 confdir[CONF_DIR_LEN]; data/batctl-2020.4/bat-hosts.h:22: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[HOST_NAME_MAX_LEN]; data/batctl-2020.4/bisect_iv.c:334: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((char *)&rt_table->entries[j], data/batctl-2020.4/bisect_iv.c:454: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_buff[MAX_LINE], *start_ptr, *start_ptr_safe, *tok_ptr; data/batctl-2020.4/bisect_iv.c:459: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). fd = fopen(file_path, "r"); data/batctl-2020.4/bisect_iv.c:626: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 curr_loop_magic[LOOP_MAGIC_LEN]; data/batctl-2020.4/bisect_iv.c:687: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 curr_loop_magic[LOOP_MAGIC_LEN], loop_check = 0; data/batctl-2020.4/bisect_iv.c:815: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 check_orig[NAME_LEN]; data/batctl-2020.4/bisect_iv.c:943: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 new_head[MAX_LINE]; data/batctl-2020.4/bisect_iv.c:976: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 head[MAX_LINE], check_orig[NAME_LEN]; data/batctl-2020.4/bisect_iv.c:1032: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(data_ptr, seqno_trace_mom->seqno_trace_neigh, data/batctl-2020.4/bisect_iv.c:1247: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 check_orig[NAME_LEN], print_trace; data/batctl-2020.4/bisect_iv.c:1310: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 check_orig[NAME_LEN]; data/batctl-2020.4/bisect_iv.c:1436: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 orig[NAME_LEN], filter_orig[NAME_LEN], *dash_ptr, *filter_orig_ptr = NULL; data/batctl-2020.4/bisect_iv.h:23: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[NAME_LEN]; data/batctl-2020.4/bisect_iv.h:26: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 loop_magic[LOOP_MAGIC_LEN]; data/batctl-2020.4/bisect_iv.h:27: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 loop_magic2[LOOP_MAGIC_LEN]; data/batctl-2020.4/bisect_iv.h:51: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 loop_magic[LOOP_MAGIC_LEN]; data/batctl-2020.4/bisect_iv.h:55: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 orig[NAME_LEN]; data/batctl-2020.4/debug.c:50: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 full_path[MAX_PATH+1]; data/batctl-2020.4/debugfs.c:21: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 debugfs_mountpoint[MAX_PATH+1]; data/batctl-2020.4/debugfs.c:50: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 type[100]; data/batctl-2020.4/debugfs.c:69: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("/proc/mounts", "r"); data/batctl-2020.4/event.c:168: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 meshif_buf[IF_NAMESIZE]; data/batctl-2020.4/event.c:296: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 meshif_buf[IF_NAMESIZE]; data/batctl-2020.4/event.c:297: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 hardif_buf[IF_NAMESIZE]; data/batctl-2020.4/event.c:343: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 meshif_buf[IF_NAMESIZE]; data/batctl-2020.4/functions.c:78: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 asc[18]; data/batctl-2020.4/functions.c:80: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(asc, "%02x:%02x:%02x:%02x:%02x:%02x", data/batctl-2020.4/functions.c:181: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 full_path[500], *buff_ptr, *space_ptr, extra_char; data/batctl-2020.4/functions.c:191:1: [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). open: data/batctl-2020.4/functions.c:193: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(full_path, "r"); data/batctl-2020.4/functions.c:306: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). goto open; data/batctl-2020.4/functions.c:326: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 full_path[500]; data/batctl-2020.4/functions.c:331: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(full_path, O_WRONLY); data/batctl-2020.4/functions.c:434: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(l3addr, &inet4->sin_addr.s_addr, data/batctl-2020.4/functions.c:439: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(l3addr, &inet6->sin6_addr.s6_addr, data/batctl-2020.4/functions.c:553: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(nl_arg->mac_result, mac, ETH_ALEN); data/batctl-2020.4/functions.c:798: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 kind[IF_NAMESIZE]; data/batctl-2020.4/functions.c:1069: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 path_buff[PATH_BUFF_LEN]; data/batctl-2020.4/functions.c:1127: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 path_buff[PATH_BUFF_LEN]; data/batctl-2020.4/functions.c:1182: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_RDONLY); data/batctl-2020.4/gw_mode.c:46: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 algoname[32]; data/batctl-2020.4/gw_mode.c:91: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 buff[256]; data/batctl-2020.4/icmp_helper.c:162:37: [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 int icmp_interface_add(const char *ifname, const uint8_t mac[ETH_ALEN]) data/batctl-2020.4/icmp_helper.c:174: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(iface->mac, mac, ETH_ALEN); data/batctl-2020.4/icmp_helper.c:291: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(iface->mac, mac, ETH_ALEN); data/batctl-2020.4/icmp_helper.c:348: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(header.ether_shost, iface->mac, ETH_ALEN); data/batctl-2020.4/icmp_helper.c:349: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(header.ether_dhost, nexthop, ETH_ALEN); data/batctl-2020.4/icmp_helper.c:365: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 ifname[IF_NAMESIZE]; data/batctl-2020.4/icmp_helper.c:390: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(&mac, icmp_packet->dst, ETH_ALEN); data/batctl-2020.4/icmp_helper.c:403: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(icmp_packet->orig, primary_mac, ETH_ALEN); data/batctl-2020.4/icmp_helper.c:408: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(icmp_packet_rr->rr[0], iface->mac, ETH_ALEN); data/batctl-2020.4/icmp_helper.c:413: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(icmp_buffer, icmp_packet, packet_len); data/batctl-2020.4/icmp_helper.c:477: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(icmp_packet, icmp_buffer, packet_len); data/batctl-2020.4/icmp_helper.c:518: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(icmp_packet_rr->rr[icmp_packet_rr->rr_cur], iface->mac, data/batctl-2020.4/icmp_helper.h:28: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/batctl-2020.4/interface.c:139: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_status[IFACE_STATUS_LEN]; data/batctl-2020.4/interface.c:141: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 path_buff[PATH_BUFF_LEN]; data/batctl-2020.4/isolation_mark.c:27: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 buff[256]; data/batctl-2020.4/loglevel.c:111: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 str[4]; data/batctl-2020.4/main.c:67: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/batctl-2020.4/main.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 mesh_iface[IF_NAMESIZE]; data/batctl-2020.4/main.h:79: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 hard_iface[IF_NAMESIZE]; data/batctl-2020.4/neighbors.c:40: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 ifname[IF_NAMESIZE]; data/batctl-2020.4/netlink.c:173:1: [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 algo_name_buf[256] = ""; data/batctl-2020.4/netlink.c:638: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(&opts->mac, orig, ETH_ALEN); data/batctl-2020.4/netlink.c:656: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(&opts.mac, mac, ETH_ALEN); data/batctl-2020.4/netlink.c:668: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(mac_out, &opts.mac, ETH_ALEN); data/batctl-2020.4/netlink.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(opts->nexthop, neigh, ETH_ALEN); data/batctl-2020.4/netlink.c:753: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(&opts.mac, mac, ETH_ALEN); data/batctl-2020.4/netlink.c:811: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(opts->primarymac, primary_mac, ETH_ALEN); data/batctl-2020.4/netlink.h:57: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. extern char algo_name_buf[256]; data/batctl-2020.4/originators.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 ifname[IF_NAMESIZE]; data/batctl-2020.4/ping.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(&icmp_packet_out.dst, dst_mac, ETH_ALEN); data/batctl-2020.4/ping.c:253: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(last_rr, icmp_packet_in.rr, BATADV_RR_LEN * ETH_ALEN); data/batctl-2020.4/routing_algo.c:139: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 full_path[MAX_PATH+1]; data/batctl-2020.4/tcpdump.c:528: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 ipsrc[INET6_ADDRSTRLEN], ipdst[INET6_ADDRSTRLEN]; data/batctl-2020.4/tcpdump.c:531: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 nd_nas_target[INET6_ADDRSTRLEN]; data/batctl-2020.4/tcpdump.c:642: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 ipsrc[INET_ADDRSTRLEN], ipdst[INET_ADDRSTRLEN]; data/batctl-2020.4/tcpdump.c:792: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 thr_str[20]; data/batctl-2020.4/tcpdump.c:1321: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 packet_buff[2000]; data/batctl-2020.4/tcpdump.c:1389: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(&tmp_wait_sockets, &wait_sockets, sizeof(fd_set)); data/batctl-2020.4/traceroute.c: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(&icmp_packet_out.dst, dst_mac, ETH_ALEN); data/batctl-2020.4/bat-hosts.c:74:7: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (sscanf(line_ptr, "%17[^ \t]%49s\n", mac_str, name) != 2) { data/batctl-2020.4/bat-hosts.c:98:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bat_host->name, name, HOST_NAME_MAX_LEN); data/batctl-2020.4/bat-hosts.c:123:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bat_host->name, name, HOST_NAME_MAX_LEN); data/batctl-2020.4/bat-hosts.c:177: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(confdir, ""); data/batctl-2020.4/bat-hosts.c:179:7: [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(bat_hosts_path[i]) >= 2 data/batctl-2020.4/bat-hosts.c:186:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(confdir, bat_hosts_path[i], CONF_DIR_LEN); data/batctl-2020.4/bisect_iv.c:81:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bat_node->name, name, NAME_LEN); data/batctl-2020.4/bisect_iv.c:351:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(rt_table->entries[i - 1].orig, orig, NAME_LEN); data/batctl-2020.4/bisect_iv.c:484:12: [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). neigh[strlen(neigh) - 1] = 0; data/batctl-2020.4/bisect_iv.c:488: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). iface_addr[strlen(iface_addr) - 1] = 0; data/batctl-2020.4/bisect_iv.c:492: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). orig[strlen(orig) - 1] = 0; data/batctl-2020.4/bisect_iv.c:496:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). prev_sender[strlen(prev_sender) - 1] = 0; data/batctl-2020.4/bisect_iv.c:548:12: [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). orig[strlen(orig) - 1] = 0; data/batctl-2020.4/bisect_iv.c:553:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). neigh[strlen(neigh) - 2] = 0; data/batctl-2020.4/bisect_iv.c:561:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). prev_sender[strlen(prev_sender) - 2] = 0; data/batctl-2020.4/bisect_iv.c:947:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strlen(head) == 1 ? "" : num_sisters == 0 ? "\\" : "|"), data/batctl-2020.4/bisect_iv.c:963:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strlen(head) > 1 ? head : num_sisters == 0 ? " " : head), data/batctl-2020.4/bisect_iv.c:964:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strlen(head) == 1 ? " " : data/batctl-2020.4/bisect_iv.c:1422:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(orig_addr, orig_name_tmp, NAME_LEN); data/batctl-2020.4/debugfs.c:36: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(debugfs_mountpoint) == 0) { data/batctl-2020.4/debugfs.c:60:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(debugfs_mountpoint, *ptr, data/batctl-2020.4/debugfs.c:75:9: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. while (fscanf(fp, "%*s %" data/batctl-2020.4/debugfs.c:135:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(debugfs_mountpoint, mountpoint, sizeof(debugfs_mountpoint)); data/batctl-2020.4/functions.c:166:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp("enabled", line, strlen("enabled"))) data/batctl-2020.4/functions.c:168:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (!strncmp("disabled", line, strlen("disabled"))) data/batctl-2020.4/functions.c:206:1: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read: data/batctl-2020.4/functions.c:224:7: [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(line_ptr) > strlen(" * xx:xx:xx:") && data/batctl-2020.4/functions.c:224: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). strlen(line_ptr) > strlen(" * xx:xx:xx:") && data/batctl-2020.4/functions.c:231:7: [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(line_ptr) > strlen(" * xx:xx:xx:") && data/batctl-2020.4/functions.c:231: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). strlen(line_ptr) > strlen(" * xx:xx:xx:") && data/batctl-2020.4/functions.c:252: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). if (strlen(buff_ptr) == ETH_STR_LEN + 1) { data/batctl-2020.4/functions.c:265: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). if (strlen(buff_ptr) != ETH_STR_LEN) data/batctl-2020.4/functions.c:298:3: [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(1000000 * watch_interval); data/batctl-2020.4/functions.c:299:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). goto read; data/batctl-2020.4/functions.c:305:3: [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(1000000 * watch_interval); data/batctl-2020.4/functions.c:341:31: [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). write_len = write(fd, arg1, strlen(arg1) + 1); data/batctl-2020.4/functions.c:400: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 (line_ptr[strlen(line_ptr) - 1] == '\n') data/batctl-2020.4/functions.c:401:12: [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_ptr[strlen(line_ptr) - 1] = '\0'; data/batctl-2020.4/functions.c:403:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(algoname, line_ptr, algoname_len); data/batctl-2020.4/functions.c:644: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(200000); data/batctl-2020.4/functions.c:856:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(link_data->kind, type, sizeof(link_data->kind)); data/batctl-2020.4/functions.c:1140: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 (line_ptr[strlen(line_ptr) - 1] == '\n') data/batctl-2020.4/functions.c:1141:12: [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_ptr[strlen(line_ptr) - 1] = '\0'; data/batctl-2020.4/functions.c:1186:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(fd, buf, buflen); data/batctl-2020.4/functions.c:1264: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(buff) > 4) { data/batctl-2020.4/functions.c:1265:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tmp_ptr = buff + strlen(buff) - 4; data/batctl-2020.4/gateways.c:129: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(algo_name_buf) == 0) data/batctl-2020.4/gw_mode.c:119:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buff, argv[2], sizeof(buff)); data/batctl-2020.4/gw_mode.c:273: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 (line_ptr[strlen(line_ptr) - 1] == '\n') data/batctl-2020.4/gw_mode.c:274:12: [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_ptr[strlen(line_ptr) - 1] = '\0'; data/batctl-2020.4/gw_mode.c:301: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 (line_ptr[strlen(line_ptr) - 1] == '\n') data/batctl-2020.4/gw_mode.c:302:12: [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_ptr[strlen(line_ptr) - 1] = '\0'; data/batctl-2020.4/icmp_helper.c:176:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(iface->name, ifname, IFNAMSIZ); data/batctl-2020.4/icmp_helper.c:187:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req.ifr_name, ifname, IFNAMSIZ); data/batctl-2020.4/interface.c:58:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(iface_status, "active\n", IFACE_STATUS_LEN); data/batctl-2020.4/interface.c:60:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(iface_status, "inactive\n", IFACE_STATUS_LEN); data/batctl-2020.4/interface.c:114: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(iface_status) > 0) data/batctl-2020.4/isolation_mark.c:37:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buff, argv[1], sizeof(buff)); data/batctl-2020.4/main.c:127:30: [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 ((line_ptr) && (line_ptr[strlen(line_ptr) - 1] == '\n')) data/batctl-2020.4/main.c:128:12: [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_ptr[strlen(line_ptr) - 1] = '\0'; data/batctl-2020.4/netlink.c:489: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(1000000 * watch_interval); data/batctl-2020.4/netlink.c:885:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(opts->algoname, algoname, opts->algoname_len); data/batctl-2020.4/originators.c:181: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(algo_name_buf) == 0) data/batctl-2020.4/routing_algo.c:209: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 (line_ptr[strlen(line_ptr) - 1] == '\n') data/batctl-2020.4/routing_algo.c:210:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). line_ptr[strlen(line_ptr) - 1] = '\0'; data/batctl-2020.4/statistics.c:98:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, state->mesh_iface, sizeof(ifr.ifr_name)); data/batctl-2020.4/sys.c:234:31: [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 (!strncmp("0", argv[1], strlen("0")) || data/batctl-2020.4/sys.c:235: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). !strncmp("disable", argv[1], strlen("disable")) || data/batctl-2020.4/sys.c:236:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). !strncmp("disabled", argv[1], strlen("disabled"))) { data/batctl-2020.4/sys.c:238:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (!strncmp("1", argv[1], strlen("1")) || data/batctl-2020.4/sys.c:239:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). !strncmp("enable", argv[1], strlen("enable")) || data/batctl-2020.4/sys.c:240: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). !strncmp("enabled", argv[1], strlen("enabled"))) { data/batctl-2020.4/tcpdump.c:1235: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(dump_if->dev) > IFNAMSIZ - 1) { data/batctl-2020.4/tcpdump.c:1247:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req.ifr_name, dump_if->dev, IFNAMSIZ); data/batctl-2020.4/tcpdump.c:1269:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req.ifr_name, dump_if->dev, IFNAMSIZ); data/batctl-2020.4/tcpdump.c:1408:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_len = read(dump_if->raw_sock, packet_buff, sizeof(packet_buff)); ANALYSIS SUMMARY: Hits = 191 Lines analyzed = 16274 in approximately 0.46 seconds (35490 lines/second) Physical Source Lines of Code (SLOC) = 11461 Hits@level = [0] 601 [1] 76 [2] 88 [3] 16 [4] 11 [5] 0 Hits@level+ = [0+] 792 [1+] 191 [2+] 115 [3+] 27 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 69.1039 [1+] 16.6652 [2+] 10.034 [3+] 2.35582 [4+] 0.959777 [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.