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/wmifinfo-0.11/nwn.c Examining data/wmifinfo-0.11/xutils.c Examining data/wmifinfo-0.11/xutils.h Examining data/wmifinfo-0.11/wmifinfo.c Examining data/wmifinfo-0.11/nwn.h FINAL RESULTS: data/wmifinfo-0.11/nwn.c:29:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, POLDHUPATH, ifname); data/wmifinfo-0.11/nwn.c:33:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, SWALLOWPATH, ifname); data/wmifinfo-0.11/nwn.c:58:5: [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(bssid, val); data/wmifinfo-0.11/wmifinfo.c:231:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%-7s", ifinfo.id); data/wmifinfo-0.11/wmifinfo.c:359:7: [4] (shell) system: 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. if (system(cmd) == -1) { data/wmifinfo-0.11/wmifinfo.c:385:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, exec_up, ifinfo.id); data/wmifinfo-0.11/wmifinfo.c:387:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, exec_down, ifinfo.id); data/wmifinfo-0.11/wmifinfo.c:438: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(parent, ifname); data/wmifinfo-0.11/wmifinfo.c:442: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->id, ifname); data/wmifinfo-0.11/wmifinfo.c:444: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(ifr.ifr_name, ifname); data/wmifinfo-0.11/wmifinfo.c:516:4: [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. sscanf(buf, "%s %x %x", a, (unsigned int *) &b, data/wmifinfo-0.11/wmifinfo.c:582:4: [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. sscanf(buf, "%s %d %d ", a, &b, &c); data/wmifinfo-0.11/wmifinfo.c:618:4: [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. sscanf(buf, "%s %d %d %d %d %d %d %d %d %d", a, &b, &d,&d,&d,&d,&d,&d,&d, &c); data/wmifinfo-0.11/wmifinfo.c:642: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(ifname[ifaces], name); data/wmifinfo-0.11/wmifinfo.c:317:13: [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((c = getopt(argc, argv, "d:i:lhu:v")) != EOF) { data/wmifinfo-0.11/nwn.c: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 buf[256]; data/wmifinfo-0.11/nwn.c:25: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 bssid[32] = ""; data/wmifinfo-0.11/nwn.c:30:6: [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). f = fopen(buf, "r"); data/wmifinfo-0.11/nwn.c:34:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(buf, "r"); data/wmifinfo-0.11/wmifinfo.c:60: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 id[16]; data/wmifinfo-0.11/wmifinfo.c:62: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 hw[6]; data/wmifinfo-0.11/wmifinfo.c:80: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 LabelColor[30] = "#79bdbf"; data/wmifinfo-0.11/wmifinfo.c:81: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 WindGustColor[30] = "#ff0000"; data/wmifinfo-0.11/wmifinfo.c:82: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 DataColor[30] = "#ffbf50"; data/wmifinfo-0.11/wmifinfo.c:83: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 BackColor[30] = "#181818"; data/wmifinfo-0.11/wmifinfo.c:84: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 StationTimeColor[30] = "#c5a6ff"; data/wmifinfo-0.11/wmifinfo.c:94: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 startif[16] = ""; data/wmifinfo-0.11/wmifinfo.c:95: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 ifname[MAXIFS][16]; data/wmifinfo-0.11/wmifinfo.c:140:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4]; data/wmifinfo-0.11/wmifinfo.c:152: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[4]; data/wmifinfo-0.11/wmifinfo.c:165: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[16]; data/wmifinfo-0.11/wmifinfo.c:371: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/wmifinfo-0.11/wmifinfo.c:425: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 parent[16]; data/wmifinfo-0.11/wmifinfo.c:426: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[1024]; data/wmifinfo-0.11/wmifinfo.c:428: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 a[16]; data/wmifinfo-0.11/wmifinfo.c:432:30: [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(froute == NULL) froute = fopen("/proc/net/route", "r"); data/wmifinfo-0.11/wmifinfo.c:433:36: [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(fwireless == NULL) fwireless = fopen("/proc/net/wireless", "r"); data/wmifinfo-0.11/wmifinfo.c:434:26: [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(fdev == NULL) fdev = fopen("/proc/net/dev", "r"); data/wmifinfo-0.11/wmifinfo.c:459: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(info->hw, ifr.ifr_hwaddr.sa_data, 6); data/wmifinfo-0.11/wmifinfo.c:478: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(info->hw, LLADDR((struct sockaddr_dl *) &ifrp->ifr_addr), 6); data/wmifinfo-0.11/wmifinfo.c:657: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 pifname[MAXIFS][16]; data/wmifinfo-0.11/wmifinfo.c:663: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[128]; data/wmifinfo-0.11/wmifinfo.c:677:6: [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). f = fopen("/proc/net/dev", "r"); data/wmifinfo-0.11/wmifinfo.c:281: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(DELAY); data/wmifinfo-0.11/wmifinfo.c:323:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(startif, optarg, sizeof(startif)); data/wmifinfo-0.11/wmifinfo.c:402: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). for (i = 0; i < strlen(str); i++) data/wmifinfo-0.11/wmifinfo.c:672:26: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). for(i=0; i<ifaces; i++) strncpy(pifname[i], ifname[i], sizeof(pifname[i])); ANALYSIS SUMMARY: Hits = 47 Lines analyzed = 1206 in approximately 0.05 seconds (24227 lines/second) Physical Source Lines of Code (SLOC) = 816 Hits@level = [0] 15 [1] 4 [2] 28 [3] 1 [4] 14 [5] 0 Hits@level+ = [0+] 62 [1+] 47 [2+] 43 [3+] 15 [4+] 14 [5+] 0 Hits/KSLOC@level+ = [0+] 75.9804 [1+] 57.598 [2+] 52.6961 [3+] 18.3824 [4+] 17.1569 [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.