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/spinner-1.2.4/usage.c
Examining data/spinner-1.2.4/usage.h
Examining data/spinner-1.2.4/spinner.c
Examining data/spinner-1.2.4/spinner.h

FINAL RESULTS:

data/spinner-1.2.4/spinner.c:445:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		 sprintf(
data/spinner-1.2.4/usage.c:38:2:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	fprintf(stderr, PACKAGE " " VERSION  " by Joe Laffey, LAFFEY Computer Imaging.\n");
data/spinner-1.2.4/usage.c:72:2:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	fprintf(stderr, PACKAGE " " VERSION " by Joe Laffey, LAFFEY Computer Imaging.\n");
data/spinner-1.2.4/spinner.c:812:15:  [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 ((ch = getopt(argc, argv, "Iut:vp:Pf:l:FRTLn")) != -1)		/* get our options */
data/spinner-1.2.4/spinner.c:909:26:  [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.
		if(NULL == (termType = getenv( "TERM" ) ))
data/spinner-1.2.4/spinner.c:182:24:  [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( 0 > (pidFileDes = open(pidFileName, O_CREAT | O_WRONLY | O_TRUNC, 0600)) )
data/spinner-1.2.4/spinner.c:249: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).
	ttyFileDes = open( whichTTY, O_WRONLY );
data/spinner-1.2.4/spinner.c:417: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 cache[sizeof(chars)][OUTPUT_STR_MAX + 1];
data/spinner-1.2.4/spinner.c:734: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 ttyName[_POSIX_PATH_MAX + 1]; 	
data/spinner-1.2.4/spinner.c:745: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 whichTTY[_POSIX_PATH_MAX + 1];
data/spinner-1.2.4/spinner.c:772: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 pidFileName[_POSIX_PATH_MAX + 1] = "";
data/spinner-1.2.4/spinner.c:775: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 logFileName[_POSIX_PATH_MAX + 1] = "";
data/spinner-1.2.4/spinner.c:778: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 fullHomePath[_POSIX_PATH_MAX + 1] = "";
data/spinner-1.2.4/spinner.c:787: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 failMsg[MAX_FAIL_MSG_LEN +1] = "";
data/spinner-1.2.4/spinner.c:839:16:  [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).
				priority = atoi(optarg);;
data/spinner-1.2.4/spinner.c:979:10:  [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).
		time = atoi(argv[0]);
data/spinner-1.2.4/spinner.c:1046: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).
		logfile = fopen(logFileName, "a");
data/spinner-1.2.4/spinner.c:158:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(0);	
data/spinner-1.2.4/spinner.c:279:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(ttyName, ttyname(ttyFileDes), _POSIX_PATH_MAX);
data/spinner-1.2.4/spinner.c:352: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).
			homePath = malloc(MAX(strlen(pwdPtr->pw_dir)+1, _POSIX_PATH_MAX+1) );
data/spinner-1.2.4/spinner.c:360:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(homePath, pwdPtr->pw_dir, _POSIX_PATH_MAX);
data/spinner-1.2.4/spinner.c:367:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(fullHomePath, homePath , _POSIX_PATH_MAX);
data/spinner-1.2.4/spinner.c:373:10:  [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).
			len = strlen(fullHomePath);
data/spinner-1.2.4/spinner.c:457: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).
	strLen = strlen(cache[0]); 
data/spinner-1.2.4/spinner.c:594: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(time);
data/spinner-1.2.4/spinner.c:717: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(time);
data/spinner-1.2.4/spinner.c:823:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(whichTTY, optarg, _POSIX_PATH_MAX);
data/spinner-1.2.4/spinner.c:847:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(pidFileName, optarg, _POSIX_PATH_MAX);
data/spinner-1.2.4/spinner.c:853:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(logFileName, optarg, _POSIX_PATH_MAX);
data/spinner-1.2.4/spinner.c:941:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(pidFileName, fullHomePath, _POSIX_PATH_MAX );
data/spinner-1.2.4/spinner.c:942:3:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
		strncat(pidFileName, DEFAULT_PID_FILENAME, (_POSIX_PATH_MAX - strlen(pidFileName) - 1) );
data/spinner-1.2.4/spinner.c:942:65:  [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).
		strncat(pidFileName, DEFAULT_PID_FILENAME, (_POSIX_PATH_MAX - strlen(pidFileName) - 1) );
data/spinner-1.2.4/spinner.c:1012:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(whichTTY, ttyname(STDIN_FILENO), _POSIX_PATH_MAX);

ANALYSIS SUMMARY:

Hits = 33
Lines analyzed = 1325 in approximately 0.06 seconds (20645 lines/second)
Physical Source Lines of Code (SLOC) = 733
Hits@level = [0]  95 [1]  16 [2]  12 [3]   2 [4]   3 [5]   0
Hits@level+ = [0+] 128 [1+]  33 [2+]  17 [3+]   5 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 174.625 [1+] 45.0205 [2+] 23.1924 [3+] 6.82128 [4+] 4.09277 [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.