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/sacc-1.00/common.h
Examining data/sacc-1.00/config.def.h
Examining data/sacc-1.00/sacc.c
Examining data/sacc-1.00/ui_ti.c
Examining data/sacc-1.00/ui_txt.c

FINAL RESULTS:

data/sacc-1.00/sacc.c:36:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, arg);
data/sacc-1.00/sacc.c:51:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	n = vsnprintf(NULL, 0, fmt, ap);
data/sacc-1.00/sacc.c:58:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf(*s, n, fmt, ap);
data/sacc-1.00/sacc.c:251:13:  [4] (shell) popen:
  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.
		pagerin = popen("$PAGER", "we");
data/sacc-1.00/sacc.c:495:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		if (access(tag, R_OK) < 0) {
data/sacc-1.00/sacc.c:550:7:  [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.
		if (execlp(plumber, plumber, url, NULL) < 0)
data/sacc-1.00/sacc.c:574:27:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if ((tag = item->tag) && access(tag, R_OK) < 0) {
data/sacc-1.00/ui_ti.c:65:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	if (vsnprintf(bufout, sizeof(bufout), fmt, ap) >= sizeof(bufout))
data/sacc-1.00/ui_ti.c:147:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	n = vsnprintf(bufout, sizeof(bufout), fmt, ap);
data/sacc-1.00/ui_ti.c:182:6:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	if (snprintf(bufout, sizeof(bufout), fmt,
data/sacc-1.00/ui_ti.c:227:7:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
		n = snprintf(bufout, sizeof(bufout), fmt,
data/sacc-1.00/ui_txt.c:76:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	n = vsnprintf(bufout, sizeof(bufout), fmt, arg);
data/sacc-1.00/ui_txt.c:103:6:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	if (snprintf(bufout, sizeof(bufout), fmt,
data/sacc-1.00/ui_txt.c:121:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	if (vsnprintf(bufout, sizeof(bufout), fmt, ap) >= sizeof(bufout))
data/sacc-1.00/ui_txt.c:204:7:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
		n = snprintf(bufout, sizeof(bufout), fmt, i, item->username,
data/sacc-1.00/sacc.c:445: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[BUFSIZ];
data/sacc-1.00/sacc.c:453:20:  [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).
	} else if ((src = open(item->tag, O_RDONLY)) < 0) {
data/sacc-1.00/sacc.c:502:14:  [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 ((dest = open(path, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0) {
data/sacc-1.00/sacc.c:591: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 ((dest = open(path, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0) {
data/sacc-1.00/sacc.c:859: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("/dev/tty", O_RDONLY)) < 0)
data/sacc-1.00/sacc.c:864:19:  [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 ((devnullfd = open("/dev/null", O_WRONLY)) < 0)
data/sacc-1.00/ui_ti.c:16:8:  [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 bufout[256];
data/sacc-1.00/ui_txt.c:13:8:  [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 bufout[256];
data/sacc-1.00/ui_txt.c:234: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[BUFSIZ], *sstr, nl;
data/sacc-1.00/sacc.c:76: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).
	slen = strlen(s);
data/sacc-1.00/sacc.c:169:28:  [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).
	    !strncmp(tag, tmpdir, strlen(tmpdir)))
data/sacc-1.00/sacc.c:365:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	} while ((n = read(sock, buf, bs)) > 0);
data/sacc-1.00/sacc.c:384:7:  [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).
	ln = strlen(selector) + 3;
data/sacc-1.00/sacc.c:460:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((r = read(src, buf, BUFSIZ)) > 0) {
data/sacc-1.00/sacc.c:676:13:  [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).
	size_t n = strlen(selector);
data/sacc-1.00/sacc.c:687:8:  [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).
		n += strlen(exp) + 2;
data/sacc-1.00/ui_ti.c:165:2:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	getchar();
data/sacc-1.00/ui_ti.c:440:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		switch (getchar()) {
data/sacc-1.00/ui_ti.c:442:12:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			switch (getchar()) {
data/sacc-1.00/ui_ti.c:450:12:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			switch (getchar()) {
data/sacc-1.00/ui_ti.c:452:9:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				if (getchar() != '~')
data/sacc-1.00/ui_ti.c:456:9:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				if (getchar() != '~')
data/sacc-1.00/ui_ti.c:460:9:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				if (getchar() != '~')
data/sacc-1.00/ui_txt.c:89:2:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	getchar();

ANALYSIS SUMMARY:

Hits = 39
Lines analyzed = 1861 in approximately 0.05 seconds (37647 lines/second)
Physical Source Lines of Code (SLOC) = 1586
Hits@level = [0]  22 [1]  15 [2]   9 [3]   0 [4]  15 [5]   0
Hits@level+ = [0+]  61 [1+]  39 [2+]  24 [3+]  15 [4+]  15 [5+]   0
Hits/KSLOC@level+ = [0+] 38.4615 [1+] 24.5902 [2+] 15.1324 [3+] 9.45776 [4+] 9.45776 [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.