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/wmfsm-0.36/wmfsm/wmfsm.c

FINAL RESULTS:

data/wmfsm-0.36/wmfsm/wmfsm.c:431:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
			strcpy(appearance, optarg);
data/wmfsm-0.36/wmfsm/wmfsm.c:537:7:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
		if (fscanf(fp, "%s %s %s %s %s\n", dummy, mountPoint, fstype, options, dummy) < 5)
data/wmfsm-0.36/wmfsm/wmfsm.c:540:7:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
		if (fscanf(fp, "%s %s %s %s %s %s\n", dummy, mountPoint, fstype, options, dummy, dummy) < 6)
data/wmfsm-0.36/wmfsm/wmfsm.c:424:7:  [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.
		c = getopt_long(argc, argv, "a:bd:fhnv", long_options, &option_index);
data/wmfsm-0.36/wmfsm/wmfsm.c:576:9:  [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.
	home = getenv("HOME");
data/wmfsm-0.36/wmfsm/wmfsm.c:118: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 *mp[100];
data/wmfsm-0.36/wmfsm/wmfsm.c:124: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 dummy[4096];
data/wmfsm-0.36/wmfsm/wmfsm.c:127: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 appearance[256] = "";
data/wmfsm-0.36/wmfsm/wmfsm.c:163: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 hostname[100];
data/wmfsm-0.36/wmfsm/wmfsm.c:437:12:  [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 = atoi(optarg);
data/wmfsm-0.36/wmfsm/wmfsm.c:516: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 mountPoint[255], dummy[255], fstype[255], options[512];
data/wmfsm-0.36/wmfsm/wmfsm.c:520: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("/etc/mnttab", "r");
data/wmfsm-0.36/wmfsm/wmfsm.c:526: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("/etc/mtab", "r");
data/wmfsm-0.36/wmfsm/wmfsm.c:566: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 confFileName[255];
data/wmfsm-0.36/wmfsm/wmfsm.c:567: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 workString[255];
data/wmfsm-0.36/wmfsm/wmfsm.c:571: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 *mount_points[100];
data/wmfsm-0.36/wmfsm/wmfsm.c:587:2:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
	strcat(confFileName, "/.wmfsmrc");
data/wmfsm-0.36/wmfsm/wmfsm.c:588:13:  [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).
	confFile = fopen(confFileName, "r");
data/wmfsm-0.36/wmfsm/wmfsm.c:206: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 (100);
data/wmfsm-0.36/wmfsm/wmfsm.c:245:56:  [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 (j = 0, dx = 0; j < LENMP && (unsigned int)j < strlen(mp[i]); j++) {
data/wmfsm-0.36/wmfsm/wmfsm.c:246: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).
					k = j + (strlen(mp[i]) > LENMP ? strlen(mp[i]) - LENMP : 0);
data/wmfsm-0.36/wmfsm/wmfsm.c:246:39:  [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).
					k = j + (strlen(mp[i]) > LENMP ? strlen(mp[i]) - LENMP : 0);
data/wmfsm-0.36/wmfsm/wmfsm.c:301: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).
				for (j = 0, dx = 0; j < 10 && (unsigned int)j < strlen(mp[i]); j++) {
data/wmfsm-0.36/wmfsm/wmfsm.c:302:27:  [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).
					c = (int) mp[i][j + (strlen(mp[i]) > 10 ? strlen(mp[i]) - 10 : 0)];
data/wmfsm-0.36/wmfsm/wmfsm.c:302:48:  [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).
					c = (int) mp[i][j + (strlen(mp[i]) > 10 ? strlen(mp[i]) - 10 : 0)];
data/wmfsm-0.36/wmfsm/wmfsm.c:354:61:  [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 (j = 0, dx = 0, dy = 47; j < 10 && (unsigned int)j < strlen(hostname); j++) {
data/wmfsm-0.36/wmfsm/wmfsm.c:396: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(delay);
data/wmfsm-0.36/wmfsm/wmfsm.c:581: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(home) > 244) {
data/wmfsm-0.36/wmfsm/wmfsm.c:586:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(confFileName, home, 245);

ANALYSIS SUMMARY:

Hits = 29
Lines analyzed = 650 in approximately 0.03 seconds (18679 lines/second)
Physical Source Lines of Code (SLOC) = 527
Hits@level = [0]  17 [1]  11 [2]  13 [3]   2 [4]   3 [5]   0
Hits@level+ = [0+]  46 [1+]  29 [2+]  18 [3+]   5 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 87.2865 [1+] 55.0285 [2+] 34.1556 [3+] 9.48767 [4+] 5.6926 [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.