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/ifplugd-0.28/src/wireless.16.h Examining data/ifplugd-0.28/src/wireless.15.h Examining data/ifplugd-0.28/src/ethtool-kernel.h Examining data/ifplugd-0.28/src/nlapi.h Examining data/ifplugd-0.28/src/ethtool-local.h Examining data/ifplugd-0.28/src/ifmonitor.h Examining data/ifplugd-0.28/src/svn-revision.h Examining data/ifplugd-0.28/src/wireless.h Examining data/ifplugd-0.28/src/nlapi.c Examining data/ifplugd-0.28/src/ifmonitor.c Examining data/ifplugd-0.28/src/ifplugstatus.c Examining data/ifplugd-0.28/src/interface.c Examining data/ifplugd-0.28/src/ifplugd.c Examining data/ifplugd-0.28/src/interface.h FINAL RESULTS: data/ifplugd-0.28/src/ifplugd.c:182:9: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(run, run, interface, arg, extra_arg, (char *) NULL); data/ifplugd-0.28/src/ifplugd.c:751:18: [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. if ((c = getopt_long(argc, argv, "asni:r:t:T:u:d:hkbUDfFvm:pqwx:cISRzlMW", long_options, &option_index)) < 0) data/ifplugd-0.28/src/ifplugstatus.c:142:18: [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. if ((c = getopt_long(argc, argv, "avhqV", long_options, &option_index)) < 0) data/ifplugd-0.28/src/ethtool-kernel.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 driver[32]; /* driver short name, "tulip", "eepro100" */ data/ifplugd-0.28/src/ethtool-kernel.h:37: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 version[32]; /* driver version string */ data/ifplugd-0.28/src/ethtool-kernel.h:38: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 fw_version[32]; /* firmware version string, if applicable */ data/ifplugd-0.28/src/ethtool-kernel.h:39: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 bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ data/ifplugd-0.28/src/ethtool-kernel.h:41: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 reserved1[32]; data/ifplugd-0.28/src/ethtool-kernel.h:42: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 reserved2[20]; data/ifplugd-0.28/src/ifmonitor.c:45:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifname[IFNAMSIZ+1]; data/ifplugd-0.28/src/ifplugd.c:104:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open("/dev/tty1", O_WRONLY|O_NOCTTY)) < 0) { data/ifplugd-0.28/src/ifplugd.c:145:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char fn[PATH_MAX]; data/ifplugd-0.28/src/ifplugd.c:154:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[256]; data/ifplugd-0.28/src/ifplugd.c:335:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char txt[256]; data/ifplugd-0.28/src/ifplugd.c:396:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char log_ident[256]; data/ifplugd-0.28/src/ifplugd.c:776:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). polltime = atoi(optarg); data/ifplugd-0.28/src/ifplugd.c:780:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pollutime = atoi(optarg); data/ifplugd-0.28/src/ifplugd.c:784:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). delay_up = atoi(optarg); data/ifplugd-0.28/src/ifplugd.c:787:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). delay_down = atoi(optarg); data/ifplugd-0.28/src/ifplugstatus.c:198:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ln[256]; data/ifplugd-0.28/src/ifplugstatus.c:200:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(f = fopen("/proc/net/dev", "r"))) { data/ifplugd-0.28/src/interface.c:191:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/ifplugd-0.28/src/interface.c:197:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(f = fopen("/proc/net/wireless", "r"))) { data/ifplugd-0.28/src/interface.c:222:17: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). q = atoi(bp); data/ifplugd-0.28/src/interface.c:308:5: [2] (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, &(req.u.ap_addr.sa_data), ETH_ALEN); data/ifplugd-0.28/src/nlapi.c:74:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char replybuf[1024]; data/ifplugd-0.28/src/wireless.15.h:514: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/ifplugd-0.28/src/wireless.15.h:553:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */ data/ifplugd-0.28/src/wireless.15.h:664: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]; /* Name of the extension */ data/ifplugd-0.28/src/wireless.16.h:539: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/ifplugd-0.28/src/wireless.16.h:578:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */ data/ifplugd-0.28/src/wireless.16.h:699: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]; /* Name of the extension */ data/ifplugd-0.28/src/ifmonitor.c:66:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifname, RTA_DATA(a), l); data/ifplugd-0.28/src/ifplugd.c:122:5: [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((argp >> 16)*1000); data/ifplugd-0.28/src/ifplugd.c:180:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0022); /* Set up a sane umask */ data/ifplugd-0.28/src/ifplugd.c:211:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(_pipe[0], &c, 1) != 1) data/ifplugd-0.28/src/ifplugd.c:341:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1); data/ifplugd-0.28/src/ifplugd.c:349:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1); data/ifplugd-0.28/src/ifplugd.c:379:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req.ifr_name, p, IFNAMSIZ); data/ifplugd-0.28/src/interface.c:49:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1); data/ifplugd-0.28/src/interface.c:96:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1); data/ifplugd-0.28/src/interface.c:124:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1); data/ifplugd-0.28/src/interface.c:154:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1); data/ifplugd-0.28/src/interface.c:177:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1); data/ifplugd-0.28/src/interface.c:195:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(iface); data/ifplugd-0.28/src/interface.c:243:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); data/ifplugd-0.28/src/interface.c:256:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); data/ifplugd-0.28/src/interface.c:300:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req.ifr_ifrn.ifrn_name, iface, IFNAMSIZ); ANALYSIS SUMMARY: Hits = 48 Lines analyzed = 3698 in approximately 0.15 seconds (24305 lines/second) Physical Source Lines of Code (SLOC) = 2068 Hits@level = [0] 31 [1] 16 [2] 29 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 79 [1+] 48 [2+] 32 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 38.2012 [1+] 23.2108 [2+] 15.4739 [3+] 1.45068 [4+] 0.483559 [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.