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/libtelnet-0.21/util/telnet-chatd.c
Examining data/libtelnet-0.21/util/telnet-client.c
Examining data/libtelnet-0.21/util/telnet-proxy.c
Examining data/libtelnet-0.21/util/telnet-test.c
Examining data/libtelnet-0.21/libtelnet.c
Examining data/libtelnet-0.21/libtelnet.h

FINAL RESULTS:

data/libtelnet-0.21/libtelnet.c:26:10:  [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.
# define vsnprintf _vsnprintf
data/libtelnet-0.21/libtelnet.c:128: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(buffer, sizeof(buffer), fmt, va);
data/libtelnet-0.21/libtelnet.c:1361:7:  [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.
	rs = vsnprintf(buffer, sizeof(buffer), fmt, va);
data/libtelnet-0.21/libtelnet.c:1369:8:  [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.
		rs = vsnprintf(output, rs + 1, fmt, va);
data/libtelnet-0.21/libtelnet.c:1426:7:  [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.
	rs = vsnprintf(buffer, sizeof(buffer), fmt, va);
data/libtelnet-0.21/libtelnet.c:1434:8:  [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.
		rs = vsnprintf(output, rs + 1, fmt, va);
data/libtelnet-0.21/libtelnet.h:55:55:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
# define TELNET_GNU_PRINTF(f,a) __attribute__((format(printf, f, a))) /*!< internal helper */
data/libtelnet-0.21/util/telnet-chatd.c:30:10:  [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.
#	define snprintf _snprintf
data/libtelnet-0.21/util/telnet-chatd.c:30:19:  [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.
#	define snprintf _snprintf
data/libtelnet-0.21/util/telnet-proxy.c:30:10:  [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.
#	define snprintf _snprintf
data/libtelnet-0.21/util/telnet-proxy.c:30:19:  [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.
#	define snprintf _snprintf
data/libtelnet-0.21/util/telnet-proxy.c:199:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		printf(COLOR_NORMAL "\n");
data/libtelnet-0.21/util/telnet-proxy.c:255:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		printf(COLOR_NORMAL "\n");
data/libtelnet-0.21/util/telnet-proxy.c:271:4:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
			printf(COLOR_NORMAL "\n");
data/libtelnet-0.21/util/telnet-proxy.c:296:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		printf(COLOR_NORMAL "\n");
data/libtelnet-0.21/util/telnet-proxy.c:309:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		printf(COLOR_NORMAL "\n");
data/libtelnet-0.21/util/telnet-client.c:131:28:  [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.
			telnet_ttype_is(telnet, getenv("TERM"));
data/libtelnet-0.21/libtelnet.c:123: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[512];
data/libtelnet-0.21/libtelnet.c:193: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 deflate_buffer[1024];
data/libtelnet-0.21/libtelnet.c:322:11:  [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.
	unsigned char bytes[3];
data/libtelnet-0.21/libtelnet.c:780:3:  [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(name, buffer + 1, size - 1);
data/libtelnet-0.21/libtelnet.c:1112: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 inflate_buffer[1024];
data/libtelnet-0.21/libtelnet.c:1166:11:  [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.
	unsigned char bytes[2];
data/libtelnet-0.21/libtelnet.c:1179: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.
		unsigned char bytes[3];
data/libtelnet-0.21/libtelnet.c:1284:11:  [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.
	unsigned char sb[3];
data/libtelnet-0.21/libtelnet.c:1295:11:  [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.
	unsigned char bytes[5];
data/libtelnet-0.21/libtelnet.c:1356: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[1024];
data/libtelnet-0.21/libtelnet.c:1421: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[1024];
data/libtelnet-0.21/util/telnet-chatd.c:57: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 linebuf[256];
data/libtelnet-0.21/util/telnet-chatd.c:217: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[512];
data/libtelnet-0.21/util/telnet-client.c:148: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[512];
data/libtelnet-0.21/util/telnet-proxy.c:74:9:  [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 buffer[4];
data/libtelnet-0.21/util/telnet-proxy.c:331: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[512];
data/libtelnet-0.21/util/telnet-test.c:29:9:  [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 buffer[4];
data/libtelnet-0.21/util/telnet-test.c:260: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[4096];
data/libtelnet-0.21/util/telnet-test.c:270: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 ((fh = fopen(argv[1], "rt")) == NULL) {
data/libtelnet-0.21/libtelnet.c:725: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).
		c += strlen(c) + 1;
data/libtelnet-0.21/libtelnet.c:737: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).
		c += strlen(c) + 1;
data/libtelnet-0.21/libtelnet.c:1471:31:  [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).
		telnet_send(telnet, string, strlen(string));
data/libtelnet-0.21/libtelnet.c:1487:23:  [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).
	_send(telnet, ttype, strlen(ttype));
data/libtelnet-0.21/libtelnet.c:1538: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).
	telnet_send(telnet, arg, strlen(arg) + 1);
data/libtelnet-0.21/util/telnet-chatd.c:138: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).
		if (strlen(line) == 0 || strlen(line) > 32) {
data/libtelnet-0.21/util/telnet-chatd.c:138: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).
		if (strlen(line) == 0 || strlen(line) > 32) {
data/libtelnet-0.21/util/telnet-client.c:222:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ((rs = read(STDIN_FILENO, buffer, sizeof(buffer))) > 0) {
data/libtelnet-0.21/util/telnet-proxy.c:268:35:  [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).
				print_buffer(ev->zmp.argv[i], strlen(ev->zmp.argv[i]));
data/libtelnet-0.21/util/telnet-proxy.c:286:45:  [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).
				print_buffer(ev->environ.values[i].var, strlen(ev->environ.values[i].var));
data/libtelnet-0.21/util/telnet-proxy.c:291: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).
					print_buffer(ev->environ.values[i].value, strlen(ev->environ.values[i].value));
data/libtelnet-0.21/util/telnet-proxy.c:304:41:  [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).
			print_buffer(ev->mssp.values[i].var, strlen(ev->mssp.values[i].var));
data/libtelnet-0.21/util/telnet-proxy.c:306:43:  [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).
			print_buffer(ev->mssp.values[i].value, strlen(ev->mssp.values[i].value));
data/libtelnet-0.21/util/telnet-test.c:221:45:  [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).
				print_encode(ev->environ.values[i].var, strlen(ev->environ.values[i].var));
data/libtelnet-0.21/util/telnet-test.c:227: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).
					print_encode(ev->environ.values[i].value, strlen(ev->environ.values[i].value));
data/libtelnet-0.21/util/telnet-test.c:238:41:  [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).
			print_encode(ev->mssp.values[i].var, strlen(ev->mssp.values[i].var));
data/libtelnet-0.21/util/telnet-test.c:240:43:  [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).
			print_encode(ev->mssp.values[i].value, strlen(ev->mssp.values[i].value));
data/libtelnet-0.21/util/telnet-test.c:287: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(buffer);

ANALYSIS SUMMARY:

Hits = 54
Lines analyzed = 3624 in approximately 0.14 seconds (25934 lines/second)
Physical Source Lines of Code (SLOC) = 2390
Hits@level = [0] 106 [1]  18 [2]  19 [3]   1 [4]  16 [5]   0
Hits@level+ = [0+] 160 [1+]  54 [2+]  36 [3+]  17 [4+]  16 [5+]   0
Hits/KSLOC@level+ = [0+] 66.9456 [1+] 22.5941 [2+] 15.0628 [3+] 7.11297 [4+] 6.69456 [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.