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/openbsd-inetd-0.20160825/pathnames.h
Examining data/openbsd-inetd-0.20160825/inetd.c

FINAL RESULTS:

data/openbsd-inetd-0.20160825/inetd.c:2131:4:  [4] (shell) execv:
  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.
			execv(sep->se_server, sep->se_argv);
data/openbsd-inetd-0.20160825/inetd.c:333: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, "dEilq:R:")) != -1)
data/openbsd-inetd-0.20160825/inetd.c:399:6:  [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 (getenv("NOTIFY_SOCKET"))
data/openbsd-inetd-0.20160825/inetd.c:220: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	*se_argv[MAXARGV+1];	/* program arguments */
data/openbsd-inetd-0.20160825/inetd.c:354:22:  [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).
			global_queuelen = atoi(optarg);
data/openbsd-inetd-0.20160825/inetd.c:472:3:  [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[DUMMYSIZE];
data/openbsd-inetd-0.20160825/inetd.c:506:3:  [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 sbuf[NI_MAXSERV];
data/openbsd-inetd-0.20160825/inetd.c:643: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 protoname[11];
data/openbsd-inetd-0.20160825/inetd.c:1120: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		line[1024];
data/openbsd-inetd-0.20160825/inetd.c:1136:12:  [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).
	fconfig = fopen(CONFIG, "r");
data/openbsd-inetd-0.20160825/inetd.c:1479: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(&sep->se_ctrladdr_storage,
data/openbsd-inetd-0.20160825/inetd.c:1611: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 hbuf[NI_MAXHOST];
data/openbsd-inetd-0.20160825/inetd.c:1629:12:  [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 ((fp = fopen("/run/inetd.pid", "w")) != NULL) {
data/openbsd-inetd-0.20160825/inetd.c:1672: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 buffer[BUFSIZE];
data/openbsd-inetd-0.20160825/inetd.c:1685: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 buffer[BUFSIZE];
data/openbsd-inetd-0.20160825/inetd.c:1702: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 buffer[BUFSIZE];
data/openbsd-inetd-0.20160825/inetd.c:1714: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 buffer[BUFSIZE];
data/openbsd-inetd-0.20160825/inetd.c:1721: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 ring[128];
data/openbsd-inetd-0.20160825/inetd.c:1741: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 text[LINESIZ+2];
data/openbsd-inetd-0.20160825/inetd.c:1774: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 text[LINESIZ+2];
data/openbsd-inetd-0.20160825/inetd.c:1850: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 buffer[256];
data/openbsd-inetd-0.20160825/inetd.c:1863: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 buffer[256];
data/openbsd-inetd-0.20160825/inetd.c:1915: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[50];
data/openbsd-inetd-0.20160825/inetd.c:402:2:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
	umask(022);
data/openbsd-inetd-0.20160825/inetd.c:804:20:  [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).
					    protoname[strlen(protoname) - 1]))
data/openbsd-inetd-0.20160825/inetd.c:805:17:  [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).
						protoname[strlen(protoname) - 1] = '\0';
data/openbsd-inetd-0.20160825/inetd.c:978:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mask = umask(0111);
data/openbsd-inetd-0.20160825/inetd.c:981:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(mask);
data/openbsd-inetd-0.20160825/inetd.c:1326:21:  [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 (sep->se_proto[strlen(sep->se_proto) - 1] == '6')
data/openbsd-inetd-0.20160825/inetd.c:1535:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c = getc(fconfig);
data/openbsd-inetd-0.20160825/inetd.c:1676:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((i = read(s, buffer, sizeof(buffer))) > 0 &&
data/openbsd-inetd-0.20160825/inetd.c:1705:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((errno = 0, read(s, buffer, sizeof(buffer)) > 0) ||
data/openbsd-inetd-0.20160825/inetd.c:1716:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	(void) read(s, buffer, sizeof(buffer));
data/openbsd-inetd-0.20160825/inetd.c:1856: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).
	(void) write(s, buffer, strlen(buffer));
data/openbsd-inetd-0.20160825/inetd.c:1877: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).
	(void) sendto(s, buffer, strlen(buffer), 0, (struct sockaddr *)&ss,
data/openbsd-inetd-0.20160825/inetd.c:2176:40:  [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 (!strncmp(__environ[i], junk[j], strlen(junk[j])))

ANALYSIS SUMMARY:

Hits = 36
Lines analyzed = 2217 in approximately 0.07 seconds (29611 lines/second)
Physical Source Lines of Code (SLOC) = 1744
Hits@level = [0]  84 [1]  13 [2]  20 [3]   2 [4]   1 [5]   0
Hits@level+ = [0+] 120 [1+]  36 [2+]  23 [3+]   3 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 68.8073 [1+] 20.6422 [2+] 13.1881 [3+] 1.72018 [4+] 0.573394 [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.