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/greed-4.2/greed.c

FINAL RESULTS:

data/greed-4.2/greed.c:75:24:  [3] (random) lrand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
#define rnd(x) (int) ((lrand48() % (x))+1)
data/greed-4.2/greed.c:234:16:  [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 ((colors = getenv("GREEDOPTS")) != (char *) NULL) {
data/greed-4.2/greed.c:521:18:  [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.
    extern char *getenv(), *tgetstr();
data/greed-4.2/greed.c:576:33:  [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 (new && tgetent(termbuf, getenv("TERM")) > 0) {
data/greed-4.2/greed.c:88: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 user[USERNAMELEN + 1];
data/greed-4.2/greed.c:517: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 termbuf[BUFSIZ];
data/greed-4.2/greed.c:535: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(SCOREFILE, O_RDWR|O_CREAT, 0600)) == -1) {
data/greed-4.2/greed.c:537:12:  [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(LOCALSCOREFILE, O_RDWR|O_CREAT, 0600)) == -1) {
data/greed-4.2/greed.c:588: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 timestr[27];
data/greed-4.2/greed.c:616: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).
	while ((fd = open(LOCKPATH, O_RDWR | O_CREAT | O_EXCL, 0)) < 0) {
data/greed-4.2/greed.c:192: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(argv[1]) != 2 || argv[1][0] != '-') usage();
data/greed-4.2/greed.c:548:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    IGNORE(read(fd, toplist, SCOREFILESIZE));
data/greed-4.2/greed.c:564:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(new->user, whoami->pw_name, USERNAMELEN);

ANALYSIS SUMMARY:

Hits = 13
Lines analyzed = 685 in approximately 0.04 seconds (15525 lines/second)
Physical Source Lines of Code (SLOC) = 488
Hits@level = [0]   5 [1]   3 [2]   6 [3]   4 [4]   0 [5]   0
Hits@level+ = [0+]  18 [1+]  13 [2+]  10 [3+]   4 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 36.8852 [1+] 26.6393 [2+] 20.4918 [3+] 8.19672 [4+]   0 [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.