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/w9wm-0.4.2/client.c Examining data/w9wm-0.4.2/cursor.c Examining data/w9wm-0.4.2/fns.h Examining data/w9wm-0.4.2/grab.c Examining data/w9wm-0.4.2/patchlevel.h Examining data/w9wm-0.4.2/error.c Examining data/w9wm-0.4.2/manage.c Examining data/w9wm-0.4.2/9wm.c Examining data/w9wm-0.4.2/dat.h Examining data/w9wm-0.4.2/menu.c FINAL RESULTS: data/w9wm-0.4.2/9wm.c:702:9: [4] (shell) execvp: 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. execvp(myargv[0], myargv); data/w9wm-0.4.2/menu.c:126:7: [4] (shell) execvp: 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. execvp(args[0], args); data/w9wm-0.4.2/menu.c:285:17: [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(shell, shell, "-c", termprog, (char *) NULL); data/w9wm-0.4.2/menu.c:289:13: [4] (shell) execlp: 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. execlp("xterm", "xterm", "-ut", (char *) NULL); data/w9wm-0.4.2/menu.c:290:13: [4] (shell) execlp: 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. execlp("9term", "9term", "-9wm", (char *) NULL); data/w9wm-0.4.2/9wm.c:148:21: [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. shell = (char *)getenv("SHELL"); data/w9wm-0.4.2/9wm.c:50: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 * progsnames[NUMMENUITEMS + 1]; data/w9wm-0.4.2/9wm.c:127:14: [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). int n = atoi(argv[++i]); data/w9wm-0.4.2/9wm.c:907:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen (buffer, "r"); data/w9wm-0.4.2/cursor.c:18: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. unsigned char mask[64]; data/w9wm-0.4.2/cursor.c:19: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. unsigned char fore[64]; data/w9wm-0.4.2/error.c:28: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 msg[80], req[80], number[80]; data/w9wm-0.4.2/error.c:39:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(number, "%d", e->request_code); data/w9wm-0.4.2/menu.c:24: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 *b2items[NUMVIRTUALS+1] = data/w9wm-0.4.2/menu.c:48: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 *b3items[B3FIXED+MAXHIDDEN+1] = data/w9wm-0.4.2/menu.c:106: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. char *p, *args[NUMARGS + 2]; data/w9wm-0.4.2/9wm.c:920: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). if (buffer[strlen(buffer)-1] == '\n') data/w9wm-0.4.2/9wm.c:921: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). buffer[strlen(buffer)-1] = 0; data/w9wm-0.4.2/grab.c:75:45: [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). tx = (wide - XTextWidth(font, m->item[i], strlen(m->item[i])))/2; data/w9wm-0.4.2/grab.c:77:53: [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). XDrawString(dpy, menuwin, gc, tx, ty, m->item[i], strlen(m->item[i])); data/w9wm-0.4.2/grab.c:100:45: [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). wide = XTextWidth(font, m->item[n], strlen(m->item[n])) + 4; ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 3058 in approximately 0.09 seconds (35153 lines/second) Physical Source Lines of Code (SLOC) = 2701 Hits@level = [0] 55 [1] 5 [2] 10 [3] 1 [4] 5 [5] 0 Hits@level+ = [0+] 76 [1+] 21 [2+] 16 [3+] 6 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 28.1377 [1+] 7.7749 [2+] 5.92373 [3+] 2.2214 [4+] 1.85117 [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.